Skip to content

Commit

Permalink
use logger
Browse files Browse the repository at this point in the history
  • Loading branch information
kraftp committed Oct 12, 2023
1 parent d9f780a commit 016cb4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hello-world-extended/src/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class Hello {
await ctxt.invoke(Hello).greetPostman(greeting);
return greeting;
} catch (e) {
console.warn("Error sending request:", e);
ctxt.logger.error(e);
await ctxt.invoke(Hello).rollbackHelloTransaction(user);
return `Greeting failed for ${user}\n`
}
Expand Down Expand Up @@ -46,13 +46,13 @@ export class Hello {
}

@OperonCommunicator()
static async greetPostman(_ctxt: CommunicatorContext, greeting: string) {
static async greetPostman(ctxt: CommunicatorContext, greeting: string) {
await axios.get("https://postman-echo.com/get", {
params: {
greeting: greeting
}
});
console.log(`Greeting sent to postman!`);
ctxt.logger.info(`Greeting sent to postman!`);
}

@PostApi('/clear/:user')
Expand Down

0 comments on commit 016cb4b

Please sign in to comment.