Error Response Format
All error responses follow the standard RaidHubResponse format:HTTP Status Codes
The API uses standard HTTP status codes to indicate the general category of error:| HTTP Status | Usage |
|---|---|
200 | Successful request |
400 | Bad request (validation errors) |
401 | Unauthorized (invalid or missing API key) |
403 | Forbidden (insufficient permissions or private profile) |
404 | Not found (resource doesn’t exist) |
500 | Internal server error |
503 | Service unavailable (Bungie.net offline or system maintenance) |
Error Codes
Authentication Errors
ApiKeyError
HTTP Status:401
Returned when the API key is missing or invalid.
Either
"Invalid API Key" or "Missing API Key"The API key that was provided (or null if missing)
The origin header from the request
InsufficientPermissionsError
HTTP Status:403
Returned when attempting to access a protected resource without proper authorization (typically admin endpoints).
Always
"Forbidden"InvalidClientSecretError
HTTP Status:403
Returned when the OAuth client secret is invalid.
Validation Errors
PathValidationError
HTTP Status:404
Returned when path parameters fail validation (e.g., invalid membership ID format).
Array of Zod validation issues describing what failed validation
QueryValidationError
HTTP Status:400
Returned when query parameters fail validation.
Array of Zod validation issues describing what failed validation
BodyValidationError
HTTP Status:400
Returned when the request body fails validation.
Array of Zod validation issues describing what failed validation
Resource Not Found Errors
These errors indicate that the requested resource does not exist in the RaidHub database. HTTP Status:404
- PlayerNotFoundError - The specified player membership ID was not found
- InstanceNotFoundError - The specified raid instance ID was not found
- PGCRNotFoundError - Post-Game Carnage Report not found for the specified instance
- PlayerNotOnLeaderboardError - The player is not ranked on the specified leaderboard
- PlayerNotInInstance - The player did not participate in the specified instance
- RaidNotFoundError - The specified raid activity ID was not found
- PantheonVersionNotFoundError - The specified Pantheon version was not found
- ClanNotFoundError - The specified clan group ID was not found
- InvalidActivityVersionComboError - The combination of activity and version is invalid
Privacy Errors
PlayerPrivateProfileError
HTTP Status:403
Returned when attempting to access profile data for a player who has set their profile to private on Bungie.net.
PlayerProtectedResourceError
HTTP Status:403
Returned when attempting to access a protected resource (like activity history) for a player without proper authorization.
Server Errors
InternalServerError
HTTP Status:500
Returned when an unexpected error occurs on the RaidHub server.
Error message (detailed in development, generic in production)
ServiceUnavailableError
HTTP Status:503
Returned when the RaidHub service is temporarily unavailable.
BungieServiceOffline
HTTP Status:503
Returned when Bungie.net services are offline and the requested data cannot be retrieved.
Other Errors
AdminQuerySyntaxError
HTTP Status:400
Returned when an admin query has invalid syntax (admin endpoints only).
Best Practices
1. Check the Success Field
Always check thesuccess field to determine if the request succeeded:
2. Handle Specific Error Codes
Implement specific handling for common error scenarios:3. Use HTTP Status Codes
Rely on HTTP status codes for broad error categorization:4. Implement Retry Logic
For503 errors and InternalServerError, implement retry logic with exponential backoff:
5. Log Error Details
Log error responses for debugging, but be careful not to log sensitive information:The
minted timestamp in error responses can help with debugging by showing exactly when the error occurred on the server.