Options
All
  • Public
  • Public/Protected
  • All
Menu

Module controllers/asyncWrapper

Index

Functions

Functions

Const asyncWrapper

  • asyncWrapper(fn: (req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>) => Promise<void>): (req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>) => Promise<void>
  • A wrapper to handle errors thrown in an Express handler

    Parameters

    • fn: (req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>) => Promise<void>

      An async Express handler function

        • (req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>): Promise<void>
        • Parameters

          • req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
          • res: Response<any, Record<string, any>>

          Returns Promise<void>

    Returns (req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>) => Promise<void>

    • A wrapped Express handler function
      • (req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>): Promise<void>
      • Parameters

        • req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
        • res: Response<any, Record<string, any>>

        Returns Promise<void>

Generated using TypeDoc