handleApiError(error): Response
Converts an ApiError into a standardized HTTP JSON response.
In production, hides sensitive error details. In development, includes stack and cause.
Parameters
error
ApiError
The ApiError to handle.
Returns
Response