Skip to Content
TachyonError Codes

Error Codes Reference

This document provides a comprehensive reference for all error codes used in the API. Each error includes a unique code, message, HTTP status, and category for easier debugging and error handling.

Error Structure

All errors follow a consistent structure:

{ code: string; // Unique error identifier (e.g., "AUTH_001") message: string; // Human-readable error message httpStatus: number; // HTTP status code category: string; // Error category (e.g., "AUTH", "VALIDATION") }

Error Categories

AUTH - Authentication & Authorization Errors

Errors related to authentication, authorization, and access control.

CodeMessageHTTP StatusDescription
AUTH_001Unauthorized access401The request requires authentication or the provided credentials are invalid
AUTH_002Invalid API key provided401The API key is malformed, expired, or doesn’t exist
AUTH_003Admin key required for this operation401This operation requires admin-level privileges
AUTH_004Invalid or malformed JWT token401The JWT token structure is invalid or corrupted
AUTH_005JWT token has expired401The JWT token has passed its expiration time
AUTH_006Invalid nonce provided401The nonce value is incorrect or doesn’t match
AUTH_007Nonce has expired401The nonce has exceeded its time-to-live
AUTH_008Invalid wallet signature401The cryptographic signature verification failed

VALIDATION - Input Validation Errors

Errors related to request data validation and format checking.

CodeMessageHTTP StatusDescription
VALIDATION_001Invalid input data400The provided input data is malformed or invalid
VALIDATION_002Invalid address format400The blockchain address format is incorrect
VALIDATION_003Invalid or unsupported chain ID400The chain ID is not recognized or supported
VALIDATION_004Request validation failed400The request failed schema validation

TRANSACTION - Transaction Processing Errors

Errors related to blockchain transactions and processing.

CodeMessageHTTP StatusDescription
TRANSACTION_001Transaction cost exceeds maximum allowed limit400The transaction cost is higher than the configured maximum
TRANSACTION_002Insufficient balance to process transaction400The account doesn’t have enough funds
TRANSACTION_003Transaction not found404The requested transaction doesn’t exist
TRANSACTION_004Error processing transaction500An unexpected error occurred during transaction processing
TRANSACTION_005Invalid gas parameters provided400Gas price or gas limit values are invalid
TRANSACTION_006Daily limit exceeded, can not process transaction400The daily transaction limit has been reached

USER - User Management Errors

Errors related to user accounts and management.

CodeMessageHTTP StatusDescription
USER_001User not found404The specified user doesn’t exist in the system
USER_002User already exists400A user with this identifier already exists
USER_003Invalid user address400The user’s address is malformed or invalid
USER_004User account has been disabled403The user account has been deactivated

SYSTEM - System-Level Errors

Errors related to system operations and infrastructure.

CodeMessageHTTP StatusDescription
SYSTEM_001Database operation failed500A database query or operation failed
SYSTEM_002Internal server error500An unexpected internal error occurred
SYSTEM_003Service temporarily unavailable503The service is temporarily down or overloaded

CHAIN - Blockchain Errors

Errors related to blockchain network operations.

CodeMessageHTTP StatusDescription
CHAIN_001Unsupported blockchain network400The specified blockchain is not supported
CHAIN_002Chain adapter operation failed500The blockchain adapter encountered an error
CHAIN_003Blockchain RPC error500Communication with the blockchain node failed
CHAIN_004Network connectivity error503Unable to connect to the blockchain network

RESOURCE - Resource Management Errors

Errors related to resource access and limits.

CodeMessageHTTP StatusDescription
RESOURCE_001Requested resource not found404The requested resource doesn’t exist
RESOURCE_002Resource conflict detected409A conflict occurred with the current state
RESOURCE_003Resource limit exceeded429Rate limit or resource quota exceeded

Usage Examples

Handling Errors in TypeScript

import { ErrorCodes } from './error-codes'; try { // API call } catch (error) { if (error.code === ErrorCodes.AUTH_TOKEN_EXPIRED.code) { // Refresh token and retry } else if (error.code === ErrorCodes.TRANSACTION_INSUFFICIENT_BALANCE.code) { // Show insufficient balance error to user } else { // Handle other errors } }

Filtering by Category

import { getErrorCodesByCategory } from './error-codes'; // Get all authentication errors const authErrors = getErrorCodesByCategory('AUTH'); console.log(authErrors);

Getting All Categories

import { getErrorCategories } from './error-codes'; const categories = getErrorCategories(); // Returns: ['AUTH', 'VALIDATION', 'TRANSACTION', 'USER', 'SYSTEM', 'CHAIN', 'RESOURCE']

HTTP Status Code Summary

StatusMeaningError Categories
400Bad RequestVALIDATION, TRANSACTION, USER, CHAIN, RESOURCE
401UnauthorizedAUTH
403ForbiddenUSER
404Not FoundTRANSACTION, USER, RESOURCE
409ConflictRESOURCE
429Too Many RequestsRESOURCE
500Internal Server ErrorTRANSACTION, SYSTEM, CHAIN
503Service UnavailableSYSTEM, CHAIN

Best Practices

  1. Always check the error code - Use the specific error code rather than just the HTTP status for precise error handling
  2. Log error codes - Include error codes in your logs for easier debugging and monitoring
  3. User-friendly messages - Map error codes to user-friendly messages in your frontend
  4. Retry logic - Implement appropriate retry logic for transient errors (503, CHAIN_004)
  5. Rate limiting - Handle RESOURCE_003 by implementing exponential backoff

Common Error Scenarios

Authentication Flow

  1. AUTH_006AUTH_007AUTH_008 → Success
  2. If any step fails, return the appropriate auth error

Transaction Processing

  1. Validate input → VALIDATION_* errors
  2. Check balance → TRANSACTION_002
  3. Check limits → TRANSACTION_001 or TRANSACTION_006
  4. Process → TRANSACTION_004 or CHAIN_* errors

User Operations

  1. Validate address → USER_003
  2. Check existence → USER_001 or USER_002
  3. Check status → USER_004
  4. Process operation
Last updated on