hzdg / hz-core

HZ's internal library of React Components 🚧
https://hz-core.netlify.com
0 stars 0 forks source link

Create ErrorBoundary component linked to logging #4

Open elainen opened 6 years ago

elainen commented 6 years ago

Would be linked to Sentry.

https://sentry.io/for/react/

aamorozov commented 5 years ago

Consider using https://github.com/getsentry/sentry-javascript/tree/master/packages/node

elainen commented 5 years ago

This may be a bigger project for our entire hz stack rather than just hz-core, since we have discussed wanting this to be part of a bigger logging configuration that we can use for new projects. See https://github.com/hzdg/dev-team/issues/9.

aamorozov commented 5 years ago

I think we can break it down on two things then - have a component that is responsible for reporting errors to sentry(it could be used in data fetching apis, for example) and another part will go to our cli and be responsible for automated setup of sentry for the project. What do you think?

lettertwo commented 5 years ago

On the component side, maybe we can build something that is sentry-agnostic and pluggable, like:

In this kind of setup, the report function might need its own spec, like:

With this kind of architecture, we could then create a SentryErrorContextProvider that provides a raven-js backed report function, but without explicitly coupling ourselves to Sentry for error reporting.


Questions

elainen commented 4 years ago

Wondering if this can also be linked with the e2e thing @toastcrunch is building with cypress.

toastcrunch commented 4 years ago

found an example of crash reporting using cypress.io+sentry.io https://glebbahmutov.com/blog/connecting-crash-reporting-with-end-to-end-tests/