Skip to content

Commit 32a2c67

Browse files
Log errors on warning level (#338)
1 parent 7b61ed4 commit 32a2c67

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

packages/restate-sdk/src/state_machine.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,7 @@ export class StateMachine implements RestateStreamConsumer {
406406
return;
407407
}
408408

409-
const error = ensureError(e);
410-
this.console.trace(
411-
"Function completed with an error: " + error.message,
412-
e
413-
);
414-
415-
this.sendErrorAndFinish(error);
409+
this.sendErrorAndFinish(ensureError(e));
416410
} catch (ee) {
417411
this.unhandledError(ensureError(ee));
418412
}
@@ -424,6 +418,7 @@ export class StateMachine implements RestateStreamConsumer {
424418
}
425419

426420
public async sendErrorAndFinish(e: Error, ctx?: JournalErrorContext) {
421+
this.console.warn("Function completed with an error.\n", e);
427422
if (e instanceof TerminalError) {
428423
this.sendTerminalError(e);
429424
} else {

0 commit comments

Comments
 (0)