Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.42 KB

bad-gateway.md

File metadata and controls

50 lines (36 loc) · 1.42 KB

What does 502 Bad Gateway mean?

The 502 Bad Gateway response code means that the server received an invalid response while working as a gateway to handle the response.

Parameters

Field Type Description Default
message string The representative message for this error. empty
options ExceptionOptions A detailed message of this error

Examples

Without arguments

import { BadGatewayException } from 'custom-error-service';
import express from 'express';

const app = express();

app.get('/', (request, response) => {
  try {
    throw new BadGatewayException();
  } catch (error) {
    handleError(error);
  }
});

With arguments

import { BadGatewayException } from 'custom-error-service';
import express from 'express';

const app = express();

app.get('/', (request, response) => {
  try {
    throw new BadGatewayException('Test Error');
  } catch (error) {
    handleError(error);
  }
});

© Copyright 2019-present - Customer Error Service by Isidro A. Lopez G.