Skip to main content

Errors

Shit happens. When something goes wrong, Integrations are welcomed to throw any of the errors provided under HttpErrors, which will then be properly handled by the SDK.

For example:

import { HttpErrors } from '@unitoio/integration-sdk';

// Some logic...

if (!page)
throw new HttpErrors.NotFoundError('Page not found');
}

HttpErrors​

BadRequestError​

To be thrown whenever expectations on the incoming requests aren't met.

UnauthorizedError​

To be thrown whenever the credentials used does not have access to the requested resource.

NotFoundError​

To be thrown whenever a requested object cannot be found.

TimeoutError​

To be thrown whenever an operation takes too long.

UnprocessableEntityError​

To be thrown whenever validation fails for a given operation (e.g. trying to create an invalid item, using an invalid combination of parameters in a request, etc.).

RateLimitExceededError​

To be thrown whenever a request is throttled.