You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users have to wrap their job handlers in try catch blocks to get error logging. We should investigate the best way to provide some sort of default error logging (to avoid jobs crashing the server, I'd assume).
One way a user suggested it to introduce some sort of jobs middleware e.g. you wrap jobs by default in error handling.
Fixeswasp-lang#2475
Introduce default error logging middleware for jobs to avoid server crashes.
* Add `errorLoggingMiddleware` function in `waspc/data/Generator/templates/sdk/wasp/server/middleware/globalMiddleware.ts` to log errors and prevent job crashes.
* Update `mage/src/server/jobs/checkForPendingApps.ts` to wrap the `checkForPendingApps` job handler with `errorLoggingMiddleware`.
* Update `mage/src/server/jobs/failStaleGenerations.ts` to wrap the `failStaleGenerations` job handler with `errorLoggingMiddleware`.
* Update documentation in `web/docs/advanced/jobs.md` to include information about the new default error logging middleware for jobs.
---
For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/wasp-lang/wasp/issues/2475?shareId=XXXX-XXXX-XXXX-XXXX).
Users have to wrap their job handlers in try catch blocks to get error logging. We should investigate the best way to provide some sort of default error logging (to avoid jobs crashing the server, I'd assume).
One way a user suggested it to introduce some sort of jobs middleware e.g. you wrap jobs by default in error handling.
Related Discord thread: https://ptb.discord.com/channels/686873244791210014/867713251479519232/1334242360263049248
The text was updated successfully, but these errors were encountered: