Skip to content

catchAsyncError

@tsed/core

Usage

typescript
import { catchAsyncError } from "@tsed/core";

See /packages/core/src/utils/catchError.ts.

Overview

ts
function catchAsyncError<T extends Error>(cb: Function): Promise<T | undefined>;

Description

Executes an async callback and returns any thrown error, or undefined if no error occurred.

Released under the MIT License.