6.1 Application Error Handling

Application services shall handle exceptions through the supported error-handling mechanism and return controlled responses. User-facing messages shall not expose stack traces, database statements, internal paths, credentials, or infrastructure details. Provide a correlation identifier where supported so that authorized operators can locate the associated diagnostic record.

Use the response status and error format defined by the applicable API specification. Authentication failures normally result in HTTP 401 and authorization failures in HTTP 403 on protected API routes; browser login flows may use redirects. Validate actual gateway and service responses. An error page displayed by the UI does not replace service-side exception handling.