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

Exception Factory via separate PR as requested #178

Conversation

hiddenalpha
Copy link
Member

No description provided.

…ption stacktraces configurable by application.
return;
}
Message<JsonObject> msg = ev.result();
JsonObject body = msg.body();
String status = body.getString(STATUS);
if (!OK.equals(status)) {
onDone.accept(new Exception("Unexpected status " + status), null);
Throwable ex = exceptionFactory.newException("Unexpected status " + status);
assert ex != null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you have to assert not Null here? If we don't trust the implementation of the Interface we would have to check everywhere we use the RedisQuesExceptionFactory

log.info("Enabling http request handler: {}", modConfig.getHttpRequestHandlerEnabled());
if (modConfig.getHttpRequestHandlerEnabled()) {
if (modConfig.getHttpRequestHandlerPort() != null && modConfig.getHttpRequestHandlerUserHeader() != null) {
RedisquesHttpRequestHandler handler = new RedisquesHttpRequestHandler(vertx, modConfig, queueStatisticsCollector, dequeueStatisticCollector);
var handler = new RedisquesHttpRequestHandler(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Congratulations, I think you are the first one in the gateelen&friends universe using var instead of the type :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

Is my assumption correct that this is a request to replace them by explicit type names? :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

No it's OK for me :-)

Copy link
Collaborator

@mcweba mcweba left a comment

Choose a reason for hiding this comment

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

Changes all look good. Before merging this to develop I would suggest to replace all occurrences of logging new Exception(...) with the new factory method

@hiddenalpha
Copy link
Member Author

hiddenalpha commented May 22, 2024

suggest to replace all occurrences of logging new Exception(...) with the new factory method

I would prefer to not do this within this PR directly. As it will mess up other WorkInProgress branches and PRs which are already on track. Leading to time consuming merge conflicts there.

Maybe I can fulfill this request in the sibbling PRs in gateleen and/or RestStorage. But in RedisQues there are other branches in progress.

@hiddenalpha hiddenalpha merged commit af32aab into swisspost:develop May 24, 2024
1 check passed
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