Fix error with woody.error-reason header (#54)

This commit is contained in:
Pavel Popov 2023-04-12 21:34:48 +08:00 committed by GitHub
parent 42a2972d9e
commit 873515a8cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -12,7 +12,7 @@
</parent>
<artifactId>adapter-common-lib</artifactId>
<version>1.2.8</version>
<version>1.2.9</version>
<packaging>jar</packaging>
<name>adapter-common-lib</name>

View File

@ -133,11 +133,12 @@ public class ErrorMapping {
}
private WRuntimeException getUnexpectedError(String code, String description, String state) {
String errorMessage = String.format("Unexpected result, code = %s, description = %s, state = %s",
code, description, state);
var errorDefinition = new WErrorDefinition(WErrorSource.INTERNAL);
errorDefinition.setErrorType(WErrorType.UNEXPECTED_ERROR);
return new WRuntimeException(
String.format("Unexpected result, code = %s, description = %s, state = %s",
code, description, state),
errorDefinition);
errorDefinition.setErrorReason(errorMessage);
return new WRuntimeException(errorMessage, errorDefinition);
}
}