File

src/core/exceptions/http-response.exception.ts

Description

implements http exception with http response from the service of common module

Extends

HttpException

Constructor

constructor(data: HttpResponse)

Http response exception contructor

Parameters :
Name Type Optional Description
data HttpResponse No

Http response

import { HttpException } from '@nestjs/common';
import { HttpResponse } from '../domain/interfaces';

//==================================================================================================
/**
 * implements http exception with http response from the service of common module
 */
export class HttpResponseException extends HttpException {
  /**
   * Http response exception contructor
   * @param data Http response
   */
  constructor(data: HttpResponse) {
    super(HttpException.createBody(data, data.description, data.status), data.status);
  }
}

//==================================================================================================

results matching ""

    No results matching ""