-
Notifications
You must be signed in to change notification settings - Fork 1.8k
chore: Capture and process order errors properly in Sentry #4173
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
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/eventyay/open-event-frontend/fizopdkqp |
Issues
======
+ Solved 5
- Added 24
See the complete overview on Codacy |
}); | ||
|
||
Sentry.configureScope(function(scope) { | ||
function addAdapterError(error: any, event: Sentry.Event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 2 spaces but found 4.
new CaptureConsole({ | ||
levels: ['error'] | ||
}) | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 2 spaces but found 4.
event.extra = { | ||
...event.extra, | ||
adapter_errors: error.errors, | ||
adapter_errors_json: JSON.stringify(error.errors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 8 spaces but found 16.
// I don't know how to turn them off | ||
return null; | ||
if (errorValue?.includes("Ember Data Request")) { | ||
if (errorValue?.includes("404")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Strings must use singlequote.
} | ||
|
||
scope.addEventProcessor(function(event: Sentry.Event, hints: Sentry.EventHint) { | ||
addAdapterError(hints.originalException, event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 4 spaces but found 8.
...event.extra, | ||
adapter_errors: error.errors, | ||
adapter_errors_json: JSON.stringify(error.errors) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Missing semicolon.
// Ignore 404 errors from Ember Data because | ||
// I don't know how to turn them off | ||
return null; | ||
if (errorValue?.includes("Ember Data Request")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Strings must use singlequote.
event.extra = { | ||
...event.extra, | ||
adapter_errors: error.errors, | ||
adapter_errors_json: JSON.stringify(error.errors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Missing space after key 'adapter_errors_json'.
if (error.isAdapterError) { | ||
event.extra = { | ||
...event.extra, | ||
adapter_errors: error.errors, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Missing space after key 'adapter_errors'.
|
||
const args: any[] = event.extra?.arguments || []; | ||
for (const arg of args) { | ||
addAdapterError(arg, event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 6 spaces but found 12.
addAdapterError(hints.originalException, event); | ||
|
||
const args: any[] = event.extra?.arguments || []; | ||
for (const arg of args) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 4 spaces but found 8.
Sentry.configureScope(function(scope) { | ||
function addAdapterError(error: any, event: Sentry.Event) { | ||
if (error.isAdapterError) { | ||
event.extra = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 6 spaces but found 12.
if (error.isAdapterError) { | ||
event.extra = { | ||
...event.extra, | ||
adapter_errors: error.errors, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 8 spaces but found 16.
Sentry.init({ | ||
integrations: [new Ember()], | ||
integrations: [ | ||
new Ember(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 4 spaces but found 8.
// Ignore 404 errors from Ember Data because | ||
// I don't know how to turn them off | ||
return null; | ||
if (errorValue?.includes("Ember Data Request")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 4 spaces but found 8.
function addAdapterError(error: any, event: Sentry.Event) { | ||
if (error.isAdapterError) { | ||
event.extra = { | ||
...event.extra, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 8 spaces but found 16.
integrations: [ | ||
new Ember(), | ||
new Dedupe(), | ||
new CaptureConsole({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 4 spaces but found 8.
|
||
Sentry.configureScope(function(scope) { | ||
function addAdapterError(error: any, event: Sentry.Event) { | ||
if (error.isAdapterError) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 4 spaces but found 8.
// I don't know how to turn them off | ||
return null; | ||
if (errorValue?.includes("Ember Data Request")) { | ||
if (errorValue?.includes("404")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 6 spaces but found 12.
addAdapterError(arg, event); | ||
} | ||
return event; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 2 spaces but found 4.
} | ||
} | ||
|
||
scope.addEventProcessor(function(event: Sentry.Event, hints: Sentry.EventHint) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 2 spaces but found 4.
integrations: [new Ember()], | ||
integrations: [ | ||
new Ember(), | ||
new Dedupe(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 4 spaces but found 8.
scope.addEventProcessor(function(event: Sentry.Event, hints: Sentry.EventHint) { | ||
addAdapterError(hints.originalException, event); | ||
|
||
const args: any[] = event.extra?.arguments || []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 4 spaces but found 8.
new Dedupe(), | ||
new CaptureConsole({ | ||
levels: ['error'] | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Expected indentation of 4 spaces but found 8.
It is as if someone deliberately told devs to not use logging and error reporting in both frontend and server. Nothing gets logged, even on critical errors, and only unhandled errors are reported, because it is not possible to suppress them, or else I think they would be suppressed as well |
Codecov Report
@@ Coverage Diff @@
## development #4173 +/- ##
==============================================
+ Coverage 22.06% 22.67% +0.6%
==============================================
Files 461 460 -1
Lines 4749 4657 -92
Branches 2 5 +3
==============================================
+ Hits 1048 1056 +8
+ Misses 3700 3599 -101
- Partials 1 2 +1
Continue to review full report at Codecov.
|
For #4174