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

Log errors generically #8907

Merged
merged 5 commits into from
Aug 5, 2024
Merged

Conversation

jnels124
Copy link
Contributor

@jnels124 jnels124 commented Jul 30, 2024

Description:

  • add handler to log uncaught errors

Related issue(s):

Fixes #8895

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@jnels124 jnels124 added enhancement Type: New feature rest Area: REST API labels Jul 30, 2024
@jnels124 jnels124 requested a review from a team July 30, 2024 17:58
@jnels124 jnels124 self-assigned this Jul 30, 2024
@jnels124 jnels124 linked an issue Jul 30, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jul 30, 2024

Codecov Report

Attention: Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.

Project coverage is 92.63%. Comparing base (068986b) to head (9da061f).
Report is 20 commits behind head on main.

Files Patch % Lines
hedera-mirror-rest/middleware/httpErrorHandler.js 93.10% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8907   +/-   ##
=========================================
  Coverage     92.63%   92.63%           
- Complexity     5149     5156    +7     
=========================================
  Files           689      688    -1     
  Lines         22207    22226   +19     
  Branches       2800     2807    +7     
=========================================
+ Hits          20571    20590   +19     
- Misses         1052     1053    +1     
+ Partials        584      583    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jnels124 jnels124 marked this pull request as ready for review July 30, 2024 21:57
@steven-sheehy steven-sheehy added this to the 0.111.0 milestone Aug 1, 2024
Signed-off-by: Jesse Nelson <[email protected]>
@jnels124
Copy link
Contributor Author

jnels124 commented Aug 2, 2024

verified non rest error thrown by server is caught by handler and when rethrown, the app exits as intended.

testing was done by adding below snippet to server.js

setTimeout(()=> {
  console.log('gonna throw exception');
  throw new Error('test exception');
}, 10000);

Signed-off-by: Jesse Nelson <[email protected]>
Signed-off-by: Jesse Nelson <[email protected]>
Signed-off-by: Jesse Nelson <[email protected]>
@jnels124 jnels124 force-pushed the 8895-update-rest-response-handling branch from 4259b14 to 9da061f Compare August 5, 2024 17:20
Copy link
Member

@steven-sheehy steven-sheehy left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

sonarqubecloud bot commented Aug 5, 2024

Copy link
Collaborator

@xin-hedera xin-hedera left a comment

Choose a reason for hiding this comment

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

LGTM

@steven-sheehy steven-sheehy merged commit 7e6b1e0 into main Aug 5, 2024
28 of 29 checks passed
@steven-sheehy steven-sheehy deleted the 8895-update-rest-response-handling branch August 5, 2024 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type: New feature rest Area: REST API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update REST Response Handling
3 participants