To help with tracing errors, all errors should be logged at creation, rather than only when the program exits.