Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key
Version: 2.2

Error Handling

Our SDK provides a comprehensive set of error codes to help you identify issues and rectify them. Errors are broadly categorized under four modules - Core, API, Auth, and Stream. Each of these modules has its unique error codes.

Core Error Codes

C0001GENERIC_CORE_ERRORAn unspecified error occurred
C0002DUPLICATE_MODULEA module wants to register with a name that already is registered
C0003MODULE_NOT_FOUNDThe specified module could not be found or not registered
C0004VALIDATION_ERRORData validation failed
C0005INVALID_ARGUMENTAn invalid argument was provided to a function or method
C0006REQUEST_ERRORAn error occurred while making a request
C0007NO_DATA_FOUNDExpected data was not found
C0008NOT_INITIALIZEDAttempted to use a component before it was initialized
C0009ALREADY_INITIALIZEDAttempted to initialize a module that was already initialized
C0010METHOD_FAILEDA method call failed
C0011STATE_MACHINE_STARTEDAttempted to start an already started state machine
C0012STATE_MACHINE_NOT_STARTEDAttempted to use a state machine that hasn't started
C0013CONFIG_KEY_NOT_EXISTThe specified configuration key doesn't exist
C0014CONFIG_INVALID_VALUEAn invalid value was provided for a configuration key
C0015CONFIG_KEY_ALREADY_EXISTAttempted to create a configuration key that already exists
C0016INVALID_DATAThe provided data is invalid
C0500BIG_NUMBER_ERROREncountered an error with big number operations
C9000NOT_IMPLEMENTEDThe called method or feature isn't implemented

API Error Codes

A0001GENERIC_API_ERRORAn unspecified error occurred while using the API
A0002PAGE_LIMIT_EXCEEDEDThe page limit for a list operation was exceeded
A0003API_KEY_NOT_SETThe API key wasn't set
A0004INVALID_PARAMSInvalid parameters were supplied to an API call
A0404NOT_FOUNDThe requested resource wasn't found
A9000NOT_IMPLEMENTEDThe requested API method or feature isn't implemented

Auth Error Codes

U0001GENERIC_AUTH_ERRORAn unspecified error occurred during authentication
U0002INCORRECT_NETWORKThe specified network is incorrect for the authentication request
U0003INCORRECT_PARAMETERThe supplied parameters for the authentication request are incorrect
U9000NOT_IMPLEMENTEDThe requested authentication method or feature isn't implemented

Stream Error Codes

S0001GENERIC_STREAM_ERRORAn unspecified error occurred with the stream request
S0002INCORRECT_NETWORKThe specified network is incorrect for the stream request
S0003INCORRECT_PARAMETERThe supplied parameters for the stream request are incorrect
S0004INVALID_SIGNATUREThe signature for the stream data is invalid
S9000NOT_IMPLEMENTEDThe requested stream method or feature isn't implemented

Error Handling Strategy

When using our SDK, ensure to implement error handling to handle these error codes. Capture the error and analyze the error code to understand the context and reason for the failure. This way, you can provide more informative feedback to your users or take corrective actions in your application.