Skip to content

Commit b23e893

Browse files
committed
Improve error logging.
1 parent 43165cc commit b23e893

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

libs/lib-services/src/errors/framework-errors.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,16 @@ export class JourneyError extends Error {
3030
return input instanceof JourneyError || input?.is_journey_error == true;
3131
}
3232

33+
private static errorMessage(data: ErrorData) {
34+
let message = `[${data.code}] ${data.description}`;
35+
if (data.details) {
36+
message += `\n ${data.details}`;
37+
}
38+
return message;
39+
}
40+
3341
constructor(data: ErrorData) {
34-
super(`[${data.code}] ${data.description}\n ${data.details}`);
42+
super(JourneyError.errorMessage(data));
3543

3644
this.errorData = data;
3745
if (data.stack) {

0 commit comments

Comments
 (0)