fermyon / spin-js-sdk

https://developer.fermyon.com/spin/javascript-components
Apache License 2.0
49 stars 17 forks source link

catch exceptions in handler function and wait until handler completes #251

Closed karthik2804 closed 3 weeks ago

karthik2804 commented 1 month ago

This PR adds a try...catch to the template so that any unhandled exceptions are caught and returned as an error instead of the generic error along the lines of event loop error - both task and job queues are empty, but expected operations did not resolveInternal error.

This PR also modifies the template so that there is an event.waitUntill on the handler function so that applications can do some work even after the response is sent.

karthik2804 commented 1 month ago

@tschneidereit I have made the change as discussed.