524 A Timeout Occurred
Cloudflare specific error. A connection was established, but the origin server took too long to send a response.
When and Why to Use It
Section titled “When and Why to Use It”Cloudflare specific error. A connection was established, but the origin server took too long to send a response.
Usage Examples
Section titled “Usage Examples”import { HttpException, get } from 'shokupan';
export const getResource = get('/resource', () => { throw new HttpException('A Timeout Occurred', 524);});import { Controller, Get, HttpException } from 'shokupan';
@Controller('/api')export class ExampleController { @Get('/resource') getResource() { throw new HttpException('A Timeout Occurred', 524); }}import express from 'express';const app = express();
app.get('/resource', (req, res) => { res.status(524).json({ error: 'A Timeout Occurred' });});import { Controller, Get, HttpException } from '@nestjs/common';
@Controller('api')export class ExampleController { @Get('resource') getResource() { throw new HttpException('A Timeout Occurred', 524); }}import Koa from 'koa';const app = new Koa();
app.use(async ctx => { if (ctx.path === '/resource' && ctx.method === 'GET') { ctx.status = 524; ctx.body = { error: 'A Timeout Occurred' }; }});