Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Error handling

Wherever possible we aim to provide users with as much debugging information as possible when rtf encounters an problem that prevents continuing execution (as opposed to early exiting with the first error encountered). To support this, the error module in the rtf-config crate provides a generic API for gathering and reporting multiple errors to the user.

The general idea is to create an ErrorBuilder whenever you are running batch logic such as templating, validation and static analysis checks. So long as there are no side effects to the logic being run, you should try to make use of an error builder to collect related errors where possible.

See the implementation of try_template for the CommandSection struct for an example of what this looks like in practice.