formatError does not pass the original error as second parameter
### Issue Description

Hi, I was using v4.2.2 and was expecting the second parameter from `formatError` would be the original error object, but that's not the case, only the error message from the original error is preserved, the rest info (code, status/statusCode, etc) are lost.

Often times we need to return the status code and some custom fields from the original error to the frontend, is there a way to do it?

### Link to Reproduction

N/A

### Reproduction Steps

_No response_