Expose HttpError to plugins
This will let them throw and show nice errors more easily.
This commit is contained in:
14
typings/pluginapi.d.ts
vendored
14
typings/pluginapi.d.ts
vendored
@ -82,6 +82,20 @@ import Websocket from "ws"
|
||||
* ]
|
||||
*/
|
||||
|
||||
export enum HttpCode {
|
||||
Ok = 200,
|
||||
Redirect = 302,
|
||||
NotFound = 404,
|
||||
BadRequest = 400,
|
||||
Unauthorized = 401,
|
||||
LargePayload = 413,
|
||||
ServerError = 500,
|
||||
}
|
||||
|
||||
export declare class HttpError extends Error {
|
||||
constructor(message: string, status: HttpCode, details?: object)
|
||||
}
|
||||
|
||||
export interface WebsocketRequest extends express.Request {
|
||||
ws: net.Socket
|
||||
head: Buffer
|
||||
|
Reference in New Issue
Block a user