---
author: besir
categories: algorithm-development
excerpt: "How to handle errors between algorithms."
image:
teaser: /icons/algo.svg
layout: article
permalink: /algorithm-development/algorithm-errors/
redirect_from:
- /algorithm-development/algorithm-basics/algorithm-errors/
show_related: true
tags: [algo-dev]
title: "Error Handling"
---
On Algorithmia you can develop in several different programming languages. This flexibility enables you to leverage your capabilities in the language(s) that you are most comfortable using, while also leveraging whichever libraries and functions best meet the needs of your specific use case. For example, you can call a NodeJS library from inside of a Python algorithm; all you have to do is to write a wrapper algorithm for that library.
There is a problem with this language-agnostic approach, though: not all programming languages are designed in the same way. This is especially true with regard to error and exception handling. Errors are often cryptic and there isn't a standard way to understand what they actually mean.
As an example, let's say you are calling a computer vision algorithm from a Java library and you get an error. If you are lucky, the author of that algorithm will have included a descriptive error message. However, depending on the message, you still might need to have a relatively strong grasp on Java programming, the Java compiler, and/or Java error types in order to understand what the error actually means, let alone to determine how to fix the issue in your code.
### Algorithm Error Codes
To be able to better support algorithm development and use across languages, we decided to create a predefined, standardized list of error types. This list is reflective of the types of algorithms that are most commonly published on the Algorithmia platform.
| Error Code |
Error Use Cases |
When To Raise |
| InputError |
Invalid Input/Image/URL/Settings/JSON |
Input, image, URL, settings, etc., provided is invalid/incomplete. |
| UnsupportedError |
Unsupported file/image, URL/Website, etc. |
Image or other file format is not supported, or scraper/parser algorithm does not explicitly support website. |
| InitializationError |
(Model) Initialization Failed |
Algorithm fails to load/initialize (ML/DL model). |
| OutOfMemoryError |
Out of Memory |
Algorithm cannot access any/additional RAM memory. |
| OutOfGpuMemoryError |
Out of GPU Memory |
Algorithm cannot access any/additional GPU memory. |
| LanguageError |
Human Language Not Supported |
Language is not supported in NLP model. |
| TooLargeError |
File/Image Size Is Too Large |
File or image size is too large or small. |
| ParsingError |
Scraping/Parsing Failed, and JSON (de)serialization failed |
Scraping/parsing fails due to changing website layout, or getting blacklisted, etc., or JSON (de)serialization failed. |
| EntityNotFoundError |
Word/entry not found in dictionary/DB |
Entry not found in DB, memory, list, file, or any other data source. |
| ThirdPartyCredentialError |
When credentials for a 3rd party service doesn't authenticate anymore |
3rd party API key fails to authenticate, or hit usage limit. |
| AlgorithmError |
When no error code has been specified, and general algorithm error class |
A general error class; returns for all other exception cases. |
Additionally, there are error codes that can only be generated on the back end. You'll receive the following error codes if the corresponding error case ever happens: