fluent.js icon indicating copy to clipboard operation
fluent.js copied to clipboard

Control error reporting via a LocalizationProvider prop

Open stasm opened this issue 5 years ago • 1 comments

We should allow users to control exactly how formatting errors are handled in Localized and getString. We could do it via a <LocalizationProvider reportError={...}> prop, which is a function taking an error.

stasm avatar Jul 29 '19 12:07 stasm

I have a real world use case for this. It's common to configure production error reporting to ignore anything at warning level or below. This is an example of a function taking an error that would capture the key miss logging at error level:

const reportError = (fluentKeyMissWarning) => {
  Dashboard.withScope((scope) => {
    scope.setLevel("error");
    Dashboard.captureException(fluentKeyMissWarning);
  });
}

akdetrick avatar Aug 03 '22 23:08 akdetrick

I would like to be able to ignore missing id errors in some cases, to avoid logging them to the console. Is there a status update for this? AFAIK there is no way to do this yet.

brunottonurb avatar May 09 '23 08:05 brunottonurb