coolify/app/Http/Controllers/Api
Andras Bacsai 4d83688896 refactor(api): return generic error messages for upstream and storage failures
Replace exception text in 5xx JSON responses with stable, action-specific
messages so API consumers get a consistent payload regardless of which
underlying client (Guzzle, PDO, filesystem) raised the exception. The
previous responses concatenated the raw upstream error, which produced
inconsistent messages and unnecessary noise for clients trying to parse
errors programmatically.

Touched endpoints:
- GET /api/v1/hetzner/{locations,server-types,images,ssh-keys}
- POST /api/v1/servers/hetzner
- DELETE /api/v1/databases/{uuid}/backups/{uuid}
- DELETE /api/v1/databases/{uuid}/backups/{uuid}/executions/{uuid}
- /download/backup/{uuid}

The RateLimitException branch and AuthenticationException flow keep their
existing curated messages.

Adds Pest coverage for the four Hetzner GET endpoints to lock the response
shape on upstream failure.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-20 11:50:30 +02:00
..
ApplicationsController.php refactor(volumes): validate input and escape shell args 2026-04-20 11:27:10 +02:00
CloudProviderTokensController.php fix(docs): remove incorrect uuid format in openapi spec (#7419) 2026-01-04 16:16:19 +01:00
DatabasesController.php refactor(api): return generic error messages for upstream and storage failures 2026-04-20 11:50:30 +02:00
DeployController.php feat(deployments): support Docker image tags for preview deployments 2026-03-30 13:35:35 +02:00
GithubController.php fix: add URL validation for GitHub source api_url and html_url fields 2026-03-26 13:45:33 +01:00
HetznerController.php refactor(api): return generic error messages for upstream and storage failures 2026-04-20 11:50:30 +02:00
OpenApi.php feat(api): Improve OpenAPI spec and add rate limit handling for Hetzner 2025-12-11 12:12:43 +01:00
OtherController.php refactor(api): validate and throttle feedback endpoint 2026-04-19 14:41:47 +02:00
ProjectController.php fix(models): replace forceFill/forceCreate with fill/create and add fillable guards 2026-03-31 13:45:31 +02:00
ResourcesController.php feat(auth): implement comprehensive authorization checks across API controllers 2025-08-23 18:51:10 +02:00
ScheduledTasksController.php fix(api): improve scheduled tasks validation and delete logic 2026-02-18 14:30:44 +01:00
SecurityController.php fix: add mass assignment protection to models 2026-03-28 12:32:57 +01:00
ServersController.php fix(validation): use int|string for Livewire numeric properties and remove nullable from API rules 2026-03-29 02:24:36 +05:30
ServicesController.php refactor(volumes): validate input and escape shell args 2026-04-20 11:27:10 +02:00
TeamController.php fix(security): harden model assignment and sensitive data handling 2026-03-29 20:56:04 +02:00