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

[SDCISA-13736, SDCISA-13746] Fix YAGNI error handling in Scheduler.java #556

Merged
merged 2 commits into from
Jan 31, 2024

Conversation

hiddenalpha
Copy link
Member

@hiddenalpha hiddenalpha commented Jan 30, 2024

Fix YAGNI error handling in Scheduler.java

Copy link

codecov bot commented Jan 30, 2024

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (edaee45) 47.44% compared to head (a37e29f) 47.47%.
Report is 9 commits behind head on develop.

Files Patch % Lines
...va/org/swisspush/gateleen/scheduler/Scheduler.java 0.00% 9 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #556      +/-   ##
=============================================
+ Coverage      47.44%   47.47%   +0.02%     
- Complexity      1790     1791       +1     
=============================================
  Files            225      225              
  Lines          11815    11820       +5     
  Branches        1237     1239       +2     
=============================================
+ Hits            5606     5611       +5     
+ Misses          5715     5714       -1     
- Partials         494      495       +1     

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

@hiddenalpha hiddenalpha marked this pull request as ready for review January 30, 2024 18:53
String queueName = "scheduler-" + name;
JsonObject enqueOp = buildEnqueueOperation(queueName, request.toJsonObject().put(QueueClient.QUEUE_TIMESTAMP, System.currentTimeMillis()).encode());
vertx.eventBus().request(redisquesAddress, enqueOp, (Handler<AsyncResult<Message<JsonObject>>>) event -> {
if( event.failed() ){
Copy link
Collaborator

Choose a reason for hiding this comment

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

code format issue

JsonObject enqueOp = buildEnqueueOperation(queueName, request.toJsonObject().put(QueueClient.QUEUE_TIMESTAMP, System.currentTimeMillis()).encode());
vertx.eventBus().request(redisquesAddress, enqueOp, (Handler<AsyncResult<Message<JsonObject>>>) event -> {
if( event.failed() ){
if( log.isWarnEnabled() ) log.warn("Could not enqueue request '{}' '{}'", queueName, request.getUri(), new Exception(event.cause()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to wrap the cause in an exception?

Copy link
Member Author

@hiddenalpha hiddenalpha Jan 31, 2024

Choose a reason for hiding this comment

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

Just imagine how the stack would look like if we don't. HINT: Our code here WILL NOT be in that stack.

@hiddenalpha hiddenalpha merged commit 0483480 into swisspost:develop Jan 31, 2024
2 of 3 checks passed
@hiddenalpha hiddenalpha deleted the ApplyFindings-20240130 branch January 31, 2024 08:46
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