Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface OnNullDecorator

Type of OnNull decorator

Hierarchy

  • OnNullDecorator

Callable

  • __call(statusOrError: number | HttpError): any
  • Defines what to do on null return value

    example
    @Controller()
    export class TestController {
      @Get('/')
      @OnUndefined(404)
      index() {
        return null
      }
    
      @Get('/test')
      test() {
        return Result([ new OnUndefined(new NotFoundError()) ], null);
      }
    }
    

    Parameters

    Returns any

Index

Constructors

Constructors

constructor

Generated using TypeDoc