Skip to main content

Variable: ERROR\_CODES

Gala Launchpad SDK 9.0.0-rc.5


Gala Launchpad SDK 9.0.0-rc.5 / index / ERROR_CODES

Variable: ERROR_CODES

const ERROR_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​

readonly ARRAY_TOO_LARGE: "ARRAY_TOO_LARGE"

Array exceeds maximum length

EMPTY_ARRAY​

readonly EMPTY_ARRAY: "EMPTY_ARRAY"

Array is empty when it shouldn't be

INVALID_DATA​

readonly INVALID_DATA: "INVALID_DATA"

Position data is malformed or incomplete

INVALID_FEE_TIER​

readonly INVALID_FEE_TIER: "INVALID_FEE_TIER"

Fee tier is not valid (500, 3000, 10000)

INVALID_FORMAT​

readonly INVALID_FORMAT: "INVALID_FORMAT"

Field doesn't match required pattern (regex)

INVALID_PARAMETERS​

readonly INVALID_PARAMETERS: "INVALID_PARAMETERS"

HTTP request parameters are invalid

INVALID_RANGE​

readonly INVALID_RANGE: "INVALID_RANGE"

Price range is invalid (min >= max)

INVALID_TICK_SPACING​

readonly INVALID_TICK_SPACING: "INVALID_TICK_SPACING"

Tick spacing doesn't match fee tier requirements

INVALID_TYPE​

readonly INVALID_TYPE: "INVALID_TYPE"

Field has wrong type (string expected, got number, etc.)

INVALID_VALUE​

readonly INVALID_VALUE: "INVALID_VALUE"

Field value is outside acceptable range or set

NOT_FOUND​

readonly NOT_FOUND: "NOT_FOUND"

Resource (position, pool, etc.) not found

REQUIRED​

readonly REQUIRED: "REQUIRED"

Field is null, undefined, or missing

TOO_LARGE​

readonly TOO_LARGE: "TOO_LARGE"

Numeric value exceeds maximum

TOO_LONG​

readonly TOO_LONG: "TOO_LONG"

Field length exceeds maximum

TOO_SHORT​

readonly TOO_SHORT: "TOO_SHORT"

Field length is below minimum

TOO_SMALL​

readonly TOO_SMALL: "TOO_SMALL"

Numeric value is below minimum

ZERO_VALUE​

readonly ZERO_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