circle-exclamationError Handling

Comprehensive guide to handling errors in the vision.meme API. Learn about error codes, formats, and best practices for robust integration.


Error Response Format

All errors follow a consistent JSON structure:

Standard Error

json

{
  "error": "Error message describing what went wrong"
}

Error with Details

json

{
  "error": "Validation error",
  "details": [
    {
      "path": ["fieldName"],
      "message": "Specific error message"
    }
  ]
}

Error with Additional Context

json


HTTP Status Codes

2xx Success

Code
Name
Description

200

OK

Request successful

201

Created

Resource created successfully

4xx Client Errors

Code
Name
Description
Common Causes

400

Bad Request

Invalid request

Missing fields, invalid format, validation errors

401

Unauthorized

Authentication failed

Missing token, expired token, invalid token

403

Forbidden

Not authorized

Wrong wallet, insufficient permissions

404

Not Found

Resource doesn't exist

Invalid mint address, deleted token

429

Too Many Requests

Rate limit exceeded

Too many requests in time window

5xx Server Errors

Code
Name
Description
Action

500

Internal Server Error

Server error

Retry request, contact support if persists

503

Service Unavailable

Service temporarily down

Retry with backoff


Common Errors

Authentication Errors

Missing Authorization Header

Status: 401 Unauthorized

json

Solution:

javascript

Invalid or Expired Token

Status: 401 Unauthorized

json

Solution:

javascript

Challenge Expired

Status: 400 Bad Request

json

Solution:

  • Request a new challenge

  • Complete signing within 5 minutes


Validation Errors

Missing Required Fields

Status: 400 Bad Request

json

Solution:

javascript

Invalid Field Values

Status: 400 Bad Request

json

Solution:

javascript

Invalid Wallet Address

Status: 400 Bad Request

json

Solution:

javascript


Resource Errors

Token Not Found

Status: 404 Not Found

json

Solution:

javascript

Forbidden Access

Status: 403 Forbidden

json

Causes:

  • Trying to update someone else's token

  • Wrong wallet authenticated

  • Insufficient permissions

Solution:

javascript


Rate Limit Errors

Rate Limit Exceeded

Status: 429 Too Many Requests

json

Headers:

http

Solution:

javascript


Transaction Errors

Transaction Expired

Status: 400 Bad Request

json

Causes:

  • Took more than 5 minutes to sign transaction

  • Network delays

Solution:

javascript

Invalid Transaction

Status: 400 Bad Request

json

Solutions:

  • Verify transaction was signed correctly

  • Check transaction format

  • Ensure no modifications after signing


File Upload Errors

File Too Large

Status: 400 Bad Request

json

Solution:

javascript

Invalid File Type

Status: 400 Bad Request

json

Solution:

javascript


Error Handling Patterns

Basic Try-Catch

javascript

Comprehensive Error Handling

javascript

Error Handler Class

javascript


Retry Strategies

Simple Retry with Delay

javascript

Exponential Backoff

javascript

Conditional Retry

javascript


Validation Before Requests

Validate data before making requests to avoid errors:

Token Creation Validation

javascript


Logging and Monitoring

Request Logging

javascript

Error Tracking

javascript


Best Practices

1. Always Handle Errors

javascript

2. Provide User-Friendly Messages

javascript

3. Log for Debugging

javascript

4. Fail Gracefully

javascript


Testing Error Scenarios

javascript


Next Steps

  • Rate Limits - Understand rate limiting

  • Code Examples - See error handling in practice

  • Token Endpoints - Learn about token operations


Need Help?


© 2025 Vision.meme. All rights reserved.

Last updated