Closed AnastasiiaSergienko closed 3 years ago
Ok, the problem occurs when you split up the error code builder call like:
ErrorMessageBuilder errorMessageBuilder = ExaError.messageBuilder("E-RR-GH-1");
errorMessageBuilder.message("A GitHub account with specified username and password doesn't exist.");
return new GitHubException(errorMessageBuilder.toString());
This must not be possible since we can not determine the value of the error message using static code analysis.
Example:
ErrorMessageBuilder errorMessageBuilder = ExaError.messageBuilder("E-TEST-1");
if(random() > 0.5) {
errorMessageBuilder.message("A");
}else{
errorMessageBuilder.message("B");
}
throw new Exception(errorMessageBuilder.toString());
By that, the exception message is defined at runtime. That makes it impossible to add it to an error catalog.
So the correct behavior, in this case, would be to give a proper exception message, explaining that this is not allowed.
Thanks for the investigation. I'll make the changes on my side
I've tried to add the plugin to the release-droid repository but something went wrong. Here is a stack trace.