Variable: ERROR\_CODES
Gala Launchpad SDK 9.0.0-rc.5 / index / ERROR_CODES
Variable: ERROR_CODES
constERROR_CODES:object
Defined in: packages/launchpad-sdk/dist/utils/errors.d.ts:27
Standard error codes for ValidationError
Use these constants instead of string literals for:
- IDE autocomplete support
- Typo prevention
- Consistent error handling across the SDK
Type Declaration
ARRAY_TOO_LARGE
readonlyARRAY_TOO_LARGE:"ARRAY_TOO_LARGE"
Array exceeds maximum length
EMPTY_ARRAY
readonlyEMPTY_ARRAY:"EMPTY_ARRAY"
Array is empty when it shouldn't be
INVALID_DATA
readonlyINVALID_DATA:"INVALID_DATA"
Position data is malformed or incomplete
INVALID_FEE_TIER
readonlyINVALID_FEE_TIER:"INVALID_FEE_TIER"
Fee tier is not valid (500, 3000, 10000)
INVALID_FORMAT
readonlyINVALID_FORMAT:"INVALID_FORMAT"
Field doesn't match required pattern (regex)
INVALID_PARAMETERS
readonlyINVALID_PARAMETERS:"INVALID_PARAMETERS"
HTTP request parameters are invalid
INVALID_RANGE
readonlyINVALID_RANGE:"INVALID_RANGE"
Price range is invalid (min >= max)
INVALID_TICK_SPACING
readonlyINVALID_TICK_SPACING:"INVALID_TICK_SPACING"
Tick spacing doesn't match fee tier requirements
INVALID_TYPE
readonlyINVALID_TYPE:"INVALID_TYPE"
Field has wrong type (string expected, got number, etc.)
INVALID_VALUE
readonlyINVALID_VALUE:"INVALID_VALUE"
Field value is outside acceptable range or set
NOT_FOUND
readonlyNOT_FOUND:"NOT_FOUND"
Resource (position, pool, etc.) not found
REQUIRED
readonlyREQUIRED:"REQUIRED"
Field is null, undefined, or missing
TOO_LARGE
readonlyTOO_LARGE:"TOO_LARGE"
Numeric value exceeds maximum
TOO_LONG
readonlyTOO_LONG:"TOO_LONG"
Field length exceeds maximum
TOO_SHORT
readonlyTOO_SHORT:"TOO_SHORT"
Field length is below minimum
TOO_SMALL
readonlyTOO_SMALL:"TOO_SMALL"
Numeric value is below minimum
ZERO_VALUE
readonlyZERO_VALUE:"ZERO_VALUE"
Value is zero when non-zero expected
Example
import { ValidationError, ERROR_CODES } from '../utils/errors';
throw new ValidationError('tokenName is required', 'tokenName', ERROR_CODES.REQUIRED);
Since
6.3.0