Skip to content

Conversation

iamareebjamal
Copy link
Member

@iamareebjamal iamareebjamal commented Mar 3, 2020

For #4174

@vercel
Copy link

vercel bot commented Mar 3, 2020

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/eventyay/open-event-frontend/fizopdkqp
✅ Preview: https://open-event-frontend-git-fork-iamareebjamal-order-error.eventyay.now.sh

@auto-label auto-label bot added the chore label Mar 3, 2020
@iamareebjamal iamareebjamal changed the title chore: Capture and process errors properly in Sentry chore: Capture and process order errors properly in Sentry Mar 3, 2020
@niranjan94
Copy link
Member

Codacy Here is an overview of what got changed by this pull request:

Issues
======
+ Solved 5
- Added 24
           

See the complete overview on Codacy

});

Sentry.configureScope(function(scope) {
function addAdapterError(error: any, event: Sentry.Event) {
Copy link
Member

Choose a reason for hiding this comment

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

new CaptureConsole({
levels: ['error']
})
],
Copy link
Member

Choose a reason for hiding this comment

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

event.extra = {
...event.extra,
adapter_errors: error.errors,
adapter_errors_json: JSON.stringify(error.errors)
Copy link
Member

Choose a reason for hiding this comment

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

// I don't know how to turn them off
return null;
if (errorValue?.includes("Ember Data Request")) {
if (errorValue?.includes("404")) {
Copy link
Member

Choose a reason for hiding this comment

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

}

scope.addEventProcessor(function(event: Sentry.Event, hints: Sentry.EventHint) {
addAdapterError(hints.originalException, event);
Copy link
Member

Choose a reason for hiding this comment

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

...event.extra,
adapter_errors: error.errors,
adapter_errors_json: JSON.stringify(error.errors)
}
Copy link
Member

Choose a reason for hiding this comment

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

Codacy 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")) {
Copy link
Member

Choose a reason for hiding this comment

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

event.extra = {
...event.extra,
adapter_errors: error.errors,
adapter_errors_json: JSON.stringify(error.errors)
Copy link
Member

Choose a reason for hiding this comment

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

if (error.isAdapterError) {
event.extra = {
...event.extra,
adapter_errors: error.errors,
Copy link
Member

Choose a reason for hiding this comment

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


const args: any[] = event.extra?.arguments || [];
for (const arg of args) {
addAdapterError(arg, event);
Copy link
Member

Choose a reason for hiding this comment

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

addAdapterError(hints.originalException, event);

const args: any[] = event.extra?.arguments || [];
for (const arg of args) {
Copy link
Member

Choose a reason for hiding this comment

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

Sentry.configureScope(function(scope) {
function addAdapterError(error: any, event: Sentry.Event) {
if (error.isAdapterError) {
event.extra = {
Copy link
Member

Choose a reason for hiding this comment

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

if (error.isAdapterError) {
event.extra = {
...event.extra,
adapter_errors: error.errors,
Copy link
Member

Choose a reason for hiding this comment

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

Sentry.init({
integrations: [new Ember()],
integrations: [
new Ember(),
Copy link
Member

Choose a reason for hiding this comment

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

// Ignore 404 errors from Ember Data because
// I don't know how to turn them off
return null;
if (errorValue?.includes("Ember Data Request")) {
Copy link
Member

Choose a reason for hiding this comment

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

function addAdapterError(error: any, event: Sentry.Event) {
if (error.isAdapterError) {
event.extra = {
...event.extra,
Copy link
Member

Choose a reason for hiding this comment

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

integrations: [
new Ember(),
new Dedupe(),
new CaptureConsole({
Copy link
Member

Choose a reason for hiding this comment

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


Sentry.configureScope(function(scope) {
function addAdapterError(error: any, event: Sentry.Event) {
if (error.isAdapterError) {
Copy link
Member

Choose a reason for hiding this comment

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

// I don't know how to turn them off
return null;
if (errorValue?.includes("Ember Data Request")) {
if (errorValue?.includes("404")) {
Copy link
Member

Choose a reason for hiding this comment

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

addAdapterError(arg, event);
}
return event;
});
Copy link
Member

Choose a reason for hiding this comment

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

}
}

scope.addEventProcessor(function(event: Sentry.Event, hints: Sentry.EventHint) {
Copy link
Member

Choose a reason for hiding this comment

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

integrations: [new Ember()],
integrations: [
new Ember(),
new Dedupe(),
Copy link
Member

Choose a reason for hiding this comment

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

scope.addEventProcessor(function(event: Sentry.Event, hints: Sentry.EventHint) {
addAdapterError(hints.originalException, event);

const args: any[] = event.extra?.arguments || [];
Copy link
Member

Choose a reason for hiding this comment

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

new Dedupe(),
new CaptureConsole({
levels: ['error']
})
Copy link
Member

Choose a reason for hiding this comment

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

@iamareebjamal
Copy link
Member Author

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
Copy link

codecov bot commented Mar 3, 2020

Codecov Report

Merging #4173 into development will increase coverage by 0.6%.
The diff coverage is 41.17%.

Impacted file tree graph

@@              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
Impacted Files Coverage Δ
app/controllers/public/index.js 0% <0%> (ø) ⬆️
app/sentry.ts 72.22% <58.33%> (-2.78%) ⬇️
app/components/ui-table-server.js
app/components/ui-table-select.js 100% <0%> (+50%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9bd12ee...7399561. Read the comment docs.

@iamareebjamal iamareebjamal merged commit 471a9ca into fossasia:development Mar 3, 2020
@iamareebjamal iamareebjamal deleted the order-error branch March 3, 2020 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants