Introduced `ExceptionHandlingMiddleware` to handle exceptions globally in the application. The middleware captures exceptions thrown during the request pipeline, logs them, and returns appropriate HTTP responses in JSON format. Key features: - Handles `JobException` with a 400 Bad Request response. - Handles unhandled exceptions with a 500 Internal Server Error. - Logs warnings for `JobException` and errors for unhandled exceptions. - Sets response `ContentType` to `application/json` and writes error details as JSON. Added necessary `using` directives for required namespaces.
2.8 KiB
2.8 KiB