# Rest API Error Handling

DevFeed: [Rest API Error Handling](<https://devfeed.tech/articles/rest-api-error-handling-19494.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/rest-api-error-handling/>)

Author: Shai Almog

Published: 2018-08-12T00:00:00Z

Content type: release

Language: en

Sources: [CodeName One](<https://devfeed.tech/sources/codename-one.md>)

Topics: [API](<https://devfeed.tech/topics/api.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [callback](<https://devfeed.tech/tags/callback.md>), [deprecated](<https://devfeed.tech/tags/deprecated.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [fetch](<https://devfeed.tech/tags/fetch.md>), [json](<https://devfeed.tech/tags/json.md>), [lambda](<https://devfeed.tech/tags/lambda.md>), [release](<https://devfeed.tech/tags/release.md>), [rest](<https://devfeed.tech/tags/rest.md>), [rest-api](<https://devfeed.tech/tags/rest-api.md>)

## AI overview

The article describes a rework of Codename One's REST API to address inconsistent error handling, including errors returned in formats other than JSON. It introduces the OnComplete interface, deprecates existing asynchronous calls, adds property business object support, and renames affected asynchronous methods with a fetch prefix.

## Source excerpt

We added a lot of features and fixed bugs over the past couple of months and I've been a bit lax on blogging. I'll try to fix that as we approach the revised 5.0 release date. One of the big changes we added over the weekend (it will be in the builds on Friday), is a huge rework of the Rest API. If you are unfamiliar with the Rest API check out this older post. The Rest API had a few problems, the most pressing of these was the inconsistent error handling behavior. A failure of the Rest call didn't always trigger error handling correctly and behaved inconsistently on reading the response of the error.