Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sentry #84

Merged
merged 3 commits into from
Nov 17, 2023
Merged

add sentry #84

merged 3 commits into from
Nov 17, 2023

Conversation

MixailE
Copy link
Contributor

@MixailE MixailE commented Nov 17, 2023

No description provided.

const message = parseError(e)
if (sendToSentry) {
if (e instanceof Error) {
console.log('catch')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

export function initSentry() {
Sentry.init({
dsn: env.VITE_SENTRY_DSN,
environment: process.env.NODE_ENV,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't have it in vite/browser, make sure it logs dev/prod correctly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

export function stringifyError(e: unknown) {
if (typeof e === 'undefined') return e
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should return something else

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If undefined we should provide some default text/error, I think

@@ -19,5 +19,6 @@ export default cleanEnv(import.meta.env, {
VITE_KETL_INVITES_BACKEND: str({
default: KETL_INVITES_BACKEND,
}),
VITE_SENTRY_DSN: str(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to update env file in the 1Pass

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

}

export function stringifyError(e: unknown) {
if (typeof e === 'undefined') return e
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If undefined we should provide some default text/error, I think

@MixailE MixailE merged commit e2c6e81 into main Nov 17, 2023
1 check passed
@MixailE MixailE deleted the add-sentry branch November 17, 2023 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants