-
Notifications
You must be signed in to change notification settings - Fork 894
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
Handle Server Side Errors #8562
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8562 +/- ##
==========================================
+ Coverage 60.93% 60.96% +0.02%
==========================================
Files 3769 3776 +7
Lines 89508 89655 +147
Branches 14013 14048 +35
==========================================
+ Hits 54541 54654 +113
- Misses 31557 31590 +33
- Partials 3410 3411 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
d1fceaa
to
4458935
Compare
Signed-off-by: Suchit Sahoo <[email protected]>
await internalRepository.incrementCounter('dql-telemetry', 'dql-telemetry', counterName); | ||
} catch (error) { | ||
logger.warn(`Unable to increment counter: ${error}`); | ||
return response.customError({ | ||
statusCode: error.status, | ||
statusCode: error.status || 403, |
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.
why the default status code be 403?
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.
+1
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.
The additional error scenario that we are trying to capture are failures during the initialization of const internalRepository = savedObjects.createScopedRepository(request);
. This failures occur if the users permissions are lacking. Hence added the default 403 since for other errors they already have an associated status code.
Signed-off-by: Suchit Sahoo <[email protected]> (cherry picked from commit 2be8d04) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: Suchit Sahoo <[email protected]>
Signed-off-by: Suchit Sahoo <[email protected]>
Description
Handles internal Server Error that were being thrown.
Issues Resolved
Screenshot
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration