What are Problem Types?
The Guile API uses RFC 9457 Problem Details for HTTP APIs to provide structured error responses. When an API operation fails, you’ll receive a response with the content typeapplication/problem+json that includes detailed information about what went wrong.
Each problem response includes:
- id: A unique identifier for this problem occurrence
- type: A URI that identifies the specific problem type
- title: A short, human-readable summary of the problem
- status: The HTTP status code
- detail: A human-readable explanation specific to this occurrence
- instance: A URI reference that identifies the specific occurrence
- attributes: Additional data specific to the problem type (optional)
General HTTP Errors
Standard HTTP error responses formatted as problem types.- https://docs.guile.app/problems/badRequest
- https://docs.guile.app/problems/unauthorized
- https://docs.guile.app/problems/forbidden
- https://docs.guile.app/problems/notFound
- https://docs.guile.app/problems/conflict
- https://docs.guile.app/problems/unprocessableEntity
- https://docs.guile.app/problems/tooManyRequests
Service-Specific Errors
Error types specific to service operations.- https://docs.guile.app/problems/barberNotFound
- https://docs.guile.app/problems/customPricingNotPermitted
- https://docs.guile.app/problems/serviceAlreadyAssigned
- https://docs.guile.app/problems/serviceNotAssignedToBarber
- https://docs.guile.app/problems/serviceNotFound
- https://docs.guile.app/problems/shopNotFound
- https://docs.guile.app/problems/tooManyVisibleServices
Using Problem Types
When you encounter an error response, check thetype field to understand the specific problem. Each problem type has its own documentation page with:
- Detailed description of when this problem occurs
- Specific remediation steps
- Additional attributes that may be included
Error Handling Best Practices
- Always check the problem type - Don’t rely solely on HTTP status codes
- Read the detail field - It provides context specific to your request
- Handle known problem types - Implement specific logic for common problems
- Log the instance URI - It helps with debugging and support requests
- Follow remediation guidance - Each problem type includes specific steps to resolve the issue