Skip to main content

Error codes and messages

This page lists every code that validators and request return, with the default message that validators shows.

The same codes and messages come back in JavaScript and Python. The message option replaces any default message except the required one. In a message, {label}, {length}, {limit}, {places}, and {date} are replaced with the option's value.

Option codes​

These codes come from the options of validators:

CodeDefault message
requiredThis field is required, or {label} is required when you set label
lengthMust be exactly {length} characters
minLengthMinimum {length} characters required
maxLengthMaximum {length} characters allowed
minValueMinimum value is {limit}
maxValueMaximum value is {limit}
decimalPlacesMaximum {places} decimal places allowed; Maximum 1 decimal place allowed for one place; Decimal values are not allowed for zero
regexInvalid format
minDateDate must be on or after {date}
maxDateDate must be on or before {date}
afterDate must be after {date}
beforeDate must be before {date}

Base rule codes​

When a base rule fails, the code is the rule's name:

CodeDefault message
alphaNumericOnly letters and numbers allowed
lettersOnlyOnly letters allowed
numbersOnlyOnly digits allowed
numberMust be a valid number
emailInvalid email format
passwordPassword must be at least 8 characters long and include uppercase, lowercase, number, and special character
dateEnter a valid date

Preset codes​

When a preset's own check fails, the code is the preset's name:

CodeDefault message
integerMust be a whole number
positiveNumberMust be greater than zero
amountEnter a valid amount (up to 2 decimal places)
weightEnter a valid weight (up to 3 decimal places)
percentageMust be a percentage between 0 and 100
decimalUpTo2Only decimal numbers up to 2 digits allowed
decimalUpTo6Only decimal numbers up to 6 digits allowed
mobileEnter a valid 10-digit mobile number
pincodeEnter a valid 6-digit PIN code
vehicleNumberEnter a valid vehicle number (e.g. KA01AB1234)
gstinEnter a valid GSTIN (e.g. 27ABCDE1234F1Z5)
panEnter a valid PAN (e.g. ABCDE1234F)
ifscEnter a valid IFSC code (e.g. HDFC0001234)
iecEnter a valid 10-character IEC code
pastDateDate cannot be in the future
futureDateDate cannot be in the past

When you build your own rule and set message, the code still names the check that failed, and the message is yours.

API client codes​

When request returns ok: false, the code is one of these:

CodeWhen
The server's code or error.codeThe server sent a code
http_<status>, such as http_404The server sent an error status without a code
failedThe server sent a 2xx status, but its body says that the call failed
timeoutNo response arrived within timeout
networkThe call couldn't reach the server; status is 0

For API errors, message is the server's message or error text, or null.