From df2f3d7df23fe1665376c267935d0c70e9a79ea4 Mon Sep 17 00:00:00 2001 From: Nicolas Molina Monroy Date: Mon, 15 Apr 2024 01:02:48 -0400 Subject: [PATCH] Fix error handling in simulator.component.ts --- apps/webapp/src/app/pages/simulator/simulator.component.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/webapp/src/app/pages/simulator/simulator.component.ts b/apps/webapp/src/app/pages/simulator/simulator.component.ts index 41ad51a..1352148 100644 --- a/apps/webapp/src/app/pages/simulator/simulator.component.ts +++ b/apps/webapp/src/app/pages/simulator/simulator.component.ts @@ -58,8 +58,6 @@ export default class SimulatorComponent implements OnInit { this.mode.set('question'); }, error: () => { - const messageError = 'Ups, something went wrong with the transcription. Please try again.'; - this.toastr.error(messageError, 'Error!'); this.mode.set('recording'); }, }); @@ -74,8 +72,9 @@ export default class SimulatorComponent implements OnInit { this.answer.set(newMessage.text); this.createFeedback(question, newMessage.text); }, - error: (error) => { - console.error(error); + error: () => { + const messageError = 'Ups, something went wrong with the transcription. Please try again.'; + this.toastr.error(messageError, 'Error!'); this.mode.set('recording'); }, });