522 Connection Timed Out
Cloudflare specific error. Cloudflare timed out trying to connect to the origin server.
When and Why to Use It
Section titled “When and Why to Use It”Cloudflare specific error. Cloudflare timed out trying to connect to the origin server.
Usage Examples
Section titled “Usage Examples”import { HttpException, get } from 'shokupan';
export const getResource = get('/resource', () => { throw new HttpException('Connection Timed Out', 522);});import { Controller, Get, HttpException } from 'shokupan';
@Controller('/api')export class ExampleController { @Get('/resource') getResource() { throw new HttpException('Connection Timed Out', 522); }}import express from 'express';const app = express();
app.get('/resource', (req, res) => { res.status(522).json({ error: 'Connection Timed Out' });});import { Controller, Get, HttpException } from '@nestjs/common';
@Controller('api')export class ExampleController { @Get('resource') getResource() { throw new HttpException('Connection Timed Out', 522); }}import Koa from 'koa';const app = new Koa();
app.use(async ctx => { if (ctx.path === '/resource' && ctx.method === 'GET') { ctx.status = 522; ctx.body = { error: 'Connection Timed Out' }; }});