36 lines
1.3 KiB
PHP
36 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* System/Domain error messages (client-facing, fixed strings)
|
|
* - Not DB-driven
|
|
* - Used in global handler/service exceptions
|
|
* - Example: throw new NotFoundHttpException(__('error.not_found'));
|
|
*/
|
|
return [
|
|
|
|
// 4xx Common
|
|
'not_found' => 'The requested URI or data was not found.', // 404
|
|
'tenant_id' => 'No active tenant is set.', // 400 (Service::tenantId() missing)
|
|
'unauthenticated' => 'Authentication failed.', // 401
|
|
'forbidden' => 'You do not have permission for this request.', // 403
|
|
'bad_request' => 'Invalid request.', // 400
|
|
|
|
// Validation / Parameters
|
|
'validation_failed' => 'Request data validation failed.', // 422
|
|
'missing_parameter' => 'A required parameter is missing.', // 400
|
|
|
|
// Resource-specific (optional, with :resource placeholder)
|
|
'not_found_resource' => ':resource could not be found.', // 404
|
|
|
|
// Business rules
|
|
'duplicate' => 'Duplicate data exists.',
|
|
'conflict' => 'The request conflicts with the current state.', // 409
|
|
'state_invalid' => 'The current state does not allow this operation.', // 400/409
|
|
|
|
// Server errors
|
|
'server_error' => 'An internal server error occurred.', // 5xx
|
|
|
|
];
|