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
feat: add forwardError option to enable error forwarding to next middleware (#2259)
* feat: add `forwardError` option to enable error forwarding to next middleware
* feat: add error middleware support in frameworkFactory for improved error handling
* feat: enhance error handling by removing response headers before forwarding errors
* feat: remove error middleware option from frameworkFactory for cleaner middleware setup
* test: update middleware tests to reflect changes in error handling with forwardError option
* test: update middleware tests to handle error forwarding for hapi framework
* feat: implement error forwarding in koa middleware and update tests accordingly
* feat: add error forwarding support in hono middleware and update tests accordingly
* feat: add forwardError option to README with usage example
Copy file name to clipboardExpand all lines: README.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,7 @@ See [below](#other-servers) for an example of use with fastify.
79
79
|**[`writeToDisk`](#writetodisk)**|`boolean\|Function`|`false`| Instructs the module to write files to the configured location on disk as specified in your `webpack` configuration. |
80
80
|**[`outputFileSystem`](#outputfilesystem)**|`Object`|[`memfs`](https://github.com/streamich/memfs)| Set the default file system which will be used by webpack as primary destination of generated files. |
81
81
|**[`modifyResponseData`](#modifyresponsedata)**|`Function`|`undefined`| Allows to set up a callback to change the response data. |
82
+
|**[`forwardError`](#forwarderror)**|`boolean`|`false`| Enable or disable forwarding errors to the next middleware. |
82
83
83
84
The middleware accepts an `options` Object. The following is a property reference for the Object.
Enable or disable forwarding errors to the next middleware. If `true`, errors will be forwarded to the next middleware, otherwise, they will be handled by `webpack-dev-middleware` and a response will be handled case by case.
486
+
487
+
This option don't work with hono, koa and hapi, because of the differences in error handling between these frameworks and express.
Copy file name to clipboardExpand all lines: src/options.json
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -172,6 +172,11 @@
172
172
"description": "Enable or disable setting `Cache-Control: public, max-age=31536000, immutable` response header for immutable assets (i.e. asset with a hash in file name like `image.a4c12bde.jpg`).",
0 commit comments