Language
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.
Typescript
try {
const kit = await lingo.fetchKit("not-a-kit-uuid");
} catch (err) {
if (err.code == lingo.Error.Code.kitNotFound) {
// Kit was not found
}
}
Some errors may include additional details in the details property of the error object. These details will vary depending on the error type.
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 unknown error occurred.
99
ServerError
A server error occurred.
103
InvalidParams
The parameters 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 and try again.
900
DeprecatedAction
The requested resource has been deprecated.
901
DeprecatedApi
The requested version of the API has been retired and is no longer available.
1100
KitNotFound
The requested kit could not be found.
1200
VersionNotFound
The requested version could not be found.
2100
SectionNotFound
The requested page 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 requested file export is not supported.
7104
FeatureUnavailable
The requested resource uses a feature that is not available for your space.