Skip to main content

handleGeneralError

handleGeneralError(error): Response

Converts a generic Error into a standardized HTTP JSON response. In production, hides sensitive error details and uses a user-friendly message if available.

Parameters

error

Error

The Error to handle.

Returns

Response