Error Handling

From Armagetron
Revision as of 11:09, 23 August 2021 by Cadillac (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
  • tASSERT: assertions, active in debug mode only. like c's assert(). Fatal program halt if the argument is false.
  • tVERIFY: the same, but active also in optimized mode.
  • st_PresentMessage(): displays/prints an error/warning message with a short caption (gets to be a title) and a longer message text. Execution continues after that.
  • st_PresentError(): the same, but exits with a fatal error after it's done.
  • tERR_WARN: prints a warning message on the console with reference to the function and source file it came from.
  • tERR_MESSAGE: similar, but uses st_PresentMessage() which makes the message more visible.
  • tERR_ERROR: still the same as tERR_WARN, but aborts.
  • tERR_ERROR_INT: internal error notifier. Same as tERR_ERROR, but asks to send bug reports.

st_Breakpoint(): does nothing useful, but in GDB, a breakpoint is set there, so if you want a breakpoint you don't have to reset on every debug session, call this.

The rest is flow control output stuff and is much less useful than anticipated. Either it gives too little or too much information. I don't use it any more.