Skip to content

Commit

Permalink
feat(web): display error stack when present for easier debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcfps committed Feb 23, 2025
1 parent 0db0352 commit 3a54b7f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/ai-workspace-common/src/utils/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,23 @@ const errTitle = {
const ignoredErrorCodes = [new ActionResultNotFoundError().code];

export const showErrorNotification = (res: BaseResponse, locale: LOCALE) => {
const { errCode, traceId } = res;
const { errCode, traceId, stack } = res;
if (ignoredErrorCodes.includes(errCode)) {
return;
}

const errMsg = getErrorMessage(errCode || new UnknownError().code, locale);
const errMsg = stack || getErrorMessage(errCode || new UnknownError().code, locale);

const description = React.createElement(
'div',
null,
React.createElement('div', null, errMsg),
React.createElement(
'div',
{
style: { fontSize: 12 },
},
errMsg,
),
traceId &&
React.createElement(
'div',
Expand Down

0 comments on commit 3a54b7f

Please sign in to comment.