Errors
When an error occurs, the Lingo API will return an error object with a code
property. You can use this code to determine the type of error that occurred and handle it accordingly.
try {
const kit = lingo.fetchKit("not-a-kit-uuid");
} catch (err) {
if (err.code == lingo.Error.Code.kitNotFound) {
// Kit was not found
}
}
Error details
Some errors may include additional details in the details
property of the error object. These details will vary depending on the error type.
Error codes
Every lingo error will include one of the codes listed here. Note that most fetches will return a specific error for the type of object being fetched.
Code
Name
Description
1
Unknown
An unkown eror occurred
99
ServerError
A server error occured.
103
InvalidParams
The paramenters or arguments provided are invalid. You may be able to check `error.details` for more information.
401
Unauthorized
Authentication error. Check your API key.
403
PermissionDenied
You do not have access to the requested content.
404
ObjectNotFound
The requested object could not be found.
429
RateLimited
You have reached the rate limit. Wait then try agin.
900
DeprecatedAction
The requested resource has been deprecated.
901
DeprecatedApi
The requested version of the API has been retired and is not longer available.
1100
KitNotFound
The requested kit could not be found.
1200
VersionNotFound
The requested version could not be found.
2100
SectionNotFound
The requested section could not be found
3100
AssetNotFound
The requested asset could not be found.
413
FileTooLarge
The file provided for an asset exceeds the size limit for the asset type.
3300
FileNotValid
The file provided for an asset is not a valid file or was not provided.
3302
FileNotAccepted
The file provided for an asset was invalid.
3304
ExportUnavailable
The request file export is not supported.
7104
FeatureUnavailable
The requested resource uses a feature that is not available for your space.