Duro API
ChangelogStatusApp
  • Welcome to Duro Dev Center
  • Getting Started
    • Introduction
    • Authentication
    • Hello World
  • Core Concepts
    • Components & Products
    • Documents
    • Change Orders
  • Advanced Topics
    • Searching and Filtering
    • Datarooms & RBAC
    • Webhooks
    • Error Handling
  • Library Configuration
    • Introduction to Duro's Config System
    • Category Registry
    • Revision Scheme
    • CPN Generation Scheme
    • CPN Schema Reference
  • Community
    • Developer Community
Powered by GitBook
On this page
  • Error Types
  • Error Format
  • Common Error Scenarios
  • Best Practices
  • Error Recovery
  • Next Steps
Export as PDF
  1. Advanced Topics

Error Handling

Learn how to handle errors and edge cases in the Duro API.

Error Types

The API returns different types of errors:

  • Validation errors

  • Authentication errors

  • Authorization errors

  • Rate limiting errors

  • Server errors

Error Format

{
  "errors": [
    {
      "message": "Not authorized to access Component",
      "path": ["component"],
      "extensions": {
        "code": "FORBIDDEN",
        "classification": "AuthorizationError"
      }
    }
  ]
}

Common Error Scenarios

# Rate Limiting Error
{
  "errors": [
    {
      "message": "Rate limit exceeded",
      "extensions": {
        "code": "RATE_LIMITED",
        "retryAfter": 60
      }
    }
  ]
}

Best Practices

  • Implement proper error handling

  • Add retry logic for rate limits

  • Log errors for debugging

  • Handle network timeouts

  • Provide user-friendly error messages

Error Recovery

async function queryWithRetry(query: string, maxRetries = 3) {
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
    try {
      return await executeQuery(query);
    } catch (error) {
      if (!isRetryableError(error) || attempt === maxRetries) {
        throw error;
      }
      await delay(exponentialBackoff(attempt));
    }
  }
}

Next Steps

PreviousWebhooksNextIntroduction to Duro's Config System

Last updated 6 months ago

Join our for support and discussions.

Developer Community