Skip to content

Commit e63f7e8

Browse files
committed
Improving HTTP WorkflowError
The content of the error response, it can be parsed according to the response type, it is set as details The title is set to HTTP reason phrase Signed-off-by: fjtirado <[email protected]>
1 parent c4cf709 commit e63f7e8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

impl/http/src/main/java/io/serverlessworkflow/impl/executors/http/HttpModelConverter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ default Entity<?> toEntity(WorkflowModel model) {
3131

3232
default WorkflowError.Builder errorFromResponse(
3333
WorkflowError.Builder errorBuilder, Response response) {
34+
errorBuilder.title(response.getStatusInfo().getReasonPhrase());
3435
try {
35-
Object title = response.readEntity(responseType());
36-
if (title != null) {
37-
errorBuilder.title(title.toString());
36+
Object details = response.readEntity(responseType());
37+
if (details != null) {
38+
errorBuilder.details(details.toString());
3839
}
3940
} catch (Exception ex) {
4041
LoggerFactory.getLogger(HttpModelConverter.class)
4142
.warn("Problem extracting error from http response", ex);
4243
}
43-
4444
return errorBuilder;
4545
}
4646
}

0 commit comments

Comments
 (0)