Errors and Warnings

12 views
Skip to first unread message

Rob Beezer

unread,
Jul 16, 2026, 7:58:27 PMJul 16
to prete...@googlegroups.com
A big cleanup for the ways the XSL and the Python communicate with authors,
publishers, and developers.

* Distinctions between warnings, errors, bugs, and fatal errors have been
documented and reflected in code. Bugs are something semi-unexpected in
PreTeXt, and not an author's fault. Most everything else is a problem caused by
bad source.

* A new category "fallback" has been added, for situations where something is
not right, but there is a good default to supply, so processing can continue.
Slightly less-severe than an error, which may leave a localized mess behind.

* Worst severity, in the Python library backing all this, is "critical". I
prefer "fatal", which my assistant pointed out is a severity and an action. And
so it is. Specifying a fatal error in the Python will also kill processing.

* Messages with mistakes, like mis-spelled severity levels, have been fixed.
Messages that seemed to not reflect the situation have been re-categorized. A
huge sweep has caught messages that never were assigned a severity - many are
deprecations with defaults supplied.

* There is now documentation to help with this. If you are a developer
contributing code, you can consult:

Chapter 52: Messages and Severity
https://pretextbook.org/doc/guide/html/messaging.html#messaging

@Oscar - the CLI can continue to use "critical" for the severity, you just need
to add an override of PreTeXt Python to your CLI Python. I'll post an issue for
you to that effect.

@Oscar, @Brad - there is a "PreTeXtFatal" exception now, which the
pretext/pretext script is catching in main() so that it can provide an exit
code of 0 or 1. I'm hoping that this will allow the CLI, and/or Runestone's
Saturday build process to distinguish between "bad things happened, but you
still have a book" and "bad news, no book was created".

See: https://github.com/PreTeXtBook/pretext/pull/3046
Reply all
Reply to author
Forward
0 new messages