Skip to main content

failAsync

Function

Unhandled Promise rejections are silently ignored by default.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

failAsync(error): void

Unhandled Promise rejections are silently ignored by default. failAsync rethrows the error, ensuring it results in an unhandled exception.

Parameters

ParameterType
errorany

Returns

void

Remarks

Note: error is not rethrown immediately, some pending JS code might still be executed. Use it as a default .catch() handler when no other error handling is provided.

Example

someAsyncFunction().catch(failAsync);