A majority of our apps no longer display the full ES error in the UI when a request fails, which can cause confusion to a user when they are trying to troubleshoot the failure.
As part of #84184, a es_error_parser.ts reusable handler was created in the es_ui_shared/server folder.
We need to audit our existing apps that are using the <SectionError/> component and update the server code to use this utility. Example usage:
if (lib.isEsError(e)) {
const error = lib.parseEsError(e.response);
return res.customError({
statusCode: e.statusCode,
body: {
message: error.message,
attributes: error,
},
});
}
// Case: default
return res.internalError({ body: e });
Note that there is already a handleEsError handler for the new ES js client that we should incorporate this logic in. We should also consider if it makes sense to create a similar handler for the legacy client.
Related issues: #77165, #63270
A majority of our apps no longer display the full ES error in the UI when a request fails, which can cause confusion to a user when they are trying to troubleshoot the failure.
As part of #84184, a
es_error_parser.tsreusable handler was created in thees_ui_shared/serverfolder.We need to audit our existing apps that are using the
<SectionError/>component and update the server code to use this utility. Example usage:Note that there is already a handleEsError handler for the new ES js client that we should incorporate this logic in. We should also consider if it makes sense to create a similar handler for the legacy client.
Related issues: #77165, #63270