Code Monkey home page Code Monkey logo

Comments (3)

pret-a-porter avatar pret-a-porter commented on May 19, 2024

Hi @mi-roh! Thanks for the issue. You can provide custom onError handler to TranslationsProvider component as property. By default it is console.error.

from eo-locale.

pret-a-porter avatar pret-a-porter commented on May 19, 2024

@mi-roh Does it work for you? Shall I close the issue?

from eo-locale.

mi-roh avatar mi-roh commented on May 19, 2024

Hi @pret-a-porter,
not really. In my subjective view, onError is ideal to link eo-locale with your monitoring. But its not useful to prefilter messages.

We already use a custom onError for our monitoring. But there is no way to filter between the Errors passed. Beside of filter on the Error-Message-Shema and grabbing the missing id with an regex.

What I haven't mentioned in my first post. Within onError there is no way to detect if a default message was used. Even that little Information would optimize the filter options.
f.e.:
this.onError(new Error(`[eo-locale] id missing "${id}" in ${this.language}. Displayed "${message}" instead.`))

I created a fork with two commits. First adds a custom missing handler. To prevent regexing on error messages. Second passes the FormatMessageOptions down to the missing handler. Custom filters or logging messages are possible for there is now a context given.

With a wrapper and some regexing we get the job done. I don't know if I'm the only one how would like to prefilter. But I would be happy for every little improvement. Even if only something like Displayed "${message}" instead. gets added to the Error.

from eo-locale.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.