Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/src/common/http.ts

25 lines
478 B
TypeScript
Raw Normal View History

2020-02-04 20:27:46 +01:00
export enum HttpCode {
Ok = 200,
Redirect = 302,
NotFound = 404,
BadRequest = 400,
Unauthorized = 401,
LargePayload = 413,
ServerError = 500,
}
export class HttpError extends Error {
public constructor(message: string, public readonly code: number) {
super(message)
this.name = this.constructor.name
}
}
export enum ApiEndpoint {
applications = "/applications",
recent = "/recent",
run = "/run",
2020-02-04 20:27:46 +01:00
session = "/session",
status = "/status",
2020-02-04 20:27:46 +01:00
}