Skip to content

Commit

Permalink
Enhance error from simulate template
Browse files Browse the repository at this point in the history
  • Loading branch information
sebelga committed Nov 24, 2020
1 parent 3a88021 commit f3b5c43
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ export function registerSimulateRoute({ router, license, lib }: RouteDependencie
return res.ok({ body: templatePreview });
} catch (e) {
if (lib.isEsError(e)) {
const error = lib.parseEsError(e.response);
return res.customError({
statusCode: e.statusCode,
body: e,
body: {
message: error.message,
attributes: error,
},
});
}
// Case: default
Expand Down

0 comments on commit f3b5c43

Please sign in to comment.