Error Codes and Recovery
This document provides a list of common error codes, their causes, and recovery steps.
Common Error Codes
400 Bad Request
Cause: Invalid input parameters or missing required fields.
Recovery Steps:
- Check the payload schema for the tool you are using.
- Ensure all required fields are included and correctly formatted.
- Validate that the data types match the expected schema.
401 Unauthorized
Cause: Authentication failed or invalid credentials.
Recovery Steps:
- Verify that the authentication mode is correctly set (standard or admin).
- Ensure the credentials are valid and have not expired.
- Check if the
TEAMDYNAMIX_ENABLE_WRITE_TOOLSflag is set if required.
403 Forbidden
Cause: Insufficient permissions to perform the requested action.
Recovery Steps:
- Verify that the user has the necessary permissions.
- Check if the
TEAMDYNAMIX_ENABLE_WRITE_TOOLSflag is set if required. - Ensure the user is assigned to the correct role or group.
404 Not Found
Cause: The requested resource does not exist.
Recovery Steps:
- Verify that the resource ID (e.g., ticket ID, user ID) is correct.
- Check if the resource exists using a read action (e.g.,
get_ticket). - Ensure the resource has not been deleted or archived.
429 Too Many Requests
Cause: Rate limit exceeded.
Recovery Steps:
- Wait for the rate limit to reset (minimum wait threshold is automatically applied).
- Implement retry logic with exponential backoff.
- Optimize your queries to reduce the number of requests.
500 Internal Server Error
Cause: An unexpected error occurred on the server.
Recovery Steps:
- Check the server logs for more detailed error information.
- Retry the request after a short delay.
- Contact support if the issue persists.
Error Recovery Decision Tree
Step 1: Identify the Error Code
- Check the error response for the HTTP status code.
Step 2: Determine the Cause
- Refer to the list of common error codes and their causes.
Step 3: Apply Recovery Steps
- Follow the recovery steps specific to the error code.
Step 4: Retry the Request
- After applying the recovery steps, retry the request.
Step 5: Escalate if Necessary
- If the issue persists, escalate to support or development team.
Examples
Example 1: Handling a 404 Not Found Error
Scenario: You try to retrieve a ticket that does not exist.
Error Response:
json
{
"error": "Not Found",
"message": "Ticket with ID 12345 not found.",
"statusCode": 404
}Recovery Steps:
- Verify the ticket ID is correct.
- Use
teamdynamix_ticketswithaction: "search_tickets"to find the correct ticket ID. - Retry the request with the correct ticket ID.
Example 2: Handling a 429 Too Many Requests Error
Scenario: You exceed the rate limit for API requests.
Error Response:
json
{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Please try again later.",
"statusCode": 429
}Recovery Steps:
- Wait for the rate limit to reset.
- Implement retry logic with exponential backoff.
- Optimize your queries to reduce the number of requests.
Example 3: Handling a 400 Bad Request Error
Scenario: You provide invalid input parameters.
Error Response:
json
{
"error": "Bad Request",
"message": "Invalid input parameters.",
"statusCode": 400
}Recovery Steps:
- Check the payload schema for the tool you are using.
- Ensure all required fields are included and correctly formatted.
- Validate that the data types match the expected schema.
Next Steps
- Review for Clarity: Ensure the documentation is clear, concise, and free of jargon.
- Validate Examples: Test all examples to ensure they work as intended.
- Address Feedback: Incorporate feedback from stakeholders to refine the documentation.