fluent.js
fluent.js copied to clipboard
Control error reporting via a LocalizationProvider prop
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.
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);
});
}
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.