fermyon / spin-js-sdk

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

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

Closed karthik2804 closed 4 months ago

karthik2804 commented 5 months 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 5 months ago

@tschneidereit I have made the change as discussed.