Skip to content

Commit

Permalink
[cosmit] more readable log from the service worker
Browse files Browse the repository at this point in the history
  • Loading branch information
nxmatic committed Jul 8, 2024
1 parent 08a0a39 commit d71e0e6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,14 @@ class ServiceWorkerMessageHandler extends ServiceWorkerComponent {
.then((response) => this.worker.developmentMode
.asConsole()
.then((console) => console
.log(`${JSON.stringify(response)} <- ServiceWorkerMessageHandler.handle(${JSON.stringify(request)})`))
.then(() => response))
.log(`ServiceWorkerMessageHandler.handle(${JSON.stringify(request)}) <- ${JSON.stringify(response)}`))
.then(() => response)) // Corrected: Close the .then() before starting .catch()
.catch((cause) => {
const response = { error: { message: cause.message, stack: cause.stack, response: cause.response } };
this.worker.developmentMode
.asConsole()
.then((console) => console
.log(`${JSON.stringify(response)} <- ServiceWorkerMessageHandler.handle(${JSON.stringify(request)})`, cause.stack));
return response;
.log(`ServiceWorkerMessageHandler.handle(${JSON.stringify(request)}) <- ${JSON.stringify(response)}`))
});
};

Expand Down

0 comments on commit d71e0e6

Please sign in to comment.