failAsync
FunctionUnhandled Promise rejections are silently ignored by default.
- Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, 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
| Parameter | Type |
|---|---|
error | any |
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);