django-ftl / fluent-compiler

High performance Python implementation of Fluent, Mozilla's l10n language
Other
21 stars 4 forks source link

Error silencing options #3

Open spookylukey opened 4 years ago

spookylukey commented 4 years ago

Currently, if you have compile-time detected errors, you get an error returned from compile_messages, and also a run-time error every time that message is used. This has some advantages:

  1. If you are not reporting compile-time errors but only run-time ones, you still get all the errors
  2. You get usage statistics with error logs, so that messages that are rarely or never used will be de-prioritised.

But there are disadvantages too:

  1. Reporting exactly the same error multiple times when once would do.
  2. Run-time performance hit for the error reporting.

So we should have an option to compile_messages to disable run-time reporting for compile-time errors.