@eggjs/errors 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +258 -0
- package/dist/base.d.ts +22 -0
- package/dist/base.js +35 -0
- package/dist/base_error.d.ts +9 -0
- package/dist/base_error.js +13 -0
- package/dist/base_exception.d.ts +9 -0
- package/dist/base_exception.js +13 -0
- package/dist/error.d.ts +9 -0
- package/dist/error.js +14 -0
- package/dist/error_options.d.ts +8 -0
- package/dist/error_options.js +8 -0
- package/dist/error_type.d.ts +18 -0
- package/dist/error_type.js +9 -0
- package/dist/exception.d.ts +9 -0
- package/dist/exception.js +14 -0
- package/dist/framework/formatter.d.ts +12 -0
- package/dist/framework/formatter.js +28 -0
- package/dist/framework/framework_base_error.d.ts +15 -0
- package/dist/framework/framework_base_error.js +37 -0
- package/dist/http/400.d.ts +8 -0
- package/dist/http/400.js +18 -0
- package/dist/http/401.d.ts +8 -0
- package/dist/http/401.js +18 -0
- package/dist/http/402.d.ts +8 -0
- package/dist/http/402.js +18 -0
- package/dist/http/403.d.ts +8 -0
- package/dist/http/403.js +18 -0
- package/dist/http/404.d.ts +8 -0
- package/dist/http/404.js +18 -0
- package/dist/http/405.d.ts +8 -0
- package/dist/http/405.js +18 -0
- package/dist/http/406.d.ts +8 -0
- package/dist/http/406.js +18 -0
- package/dist/http/407.d.ts +8 -0
- package/dist/http/407.js +18 -0
- package/dist/http/408.d.ts +8 -0
- package/dist/http/408.js +18 -0
- package/dist/http/409.d.ts +8 -0
- package/dist/http/409.js +18 -0
- package/dist/http/410.d.ts +8 -0
- package/dist/http/410.js +18 -0
- package/dist/http/411.d.ts +8 -0
- package/dist/http/411.js +18 -0
- package/dist/http/412.d.ts +8 -0
- package/dist/http/412.js +18 -0
- package/dist/http/413.d.ts +8 -0
- package/dist/http/413.js +18 -0
- package/dist/http/414.d.ts +8 -0
- package/dist/http/414.js +18 -0
- package/dist/http/415.d.ts +8 -0
- package/dist/http/415.js +18 -0
- package/dist/http/416.d.ts +8 -0
- package/dist/http/416.js +18 -0
- package/dist/http/417.d.ts +8 -0
- package/dist/http/417.js +18 -0
- package/dist/http/418.d.ts +8 -0
- package/dist/http/418.js +18 -0
- package/dist/http/421.d.ts +8 -0
- package/dist/http/421.js +18 -0
- package/dist/http/422.d.ts +8 -0
- package/dist/http/422.js +18 -0
- package/dist/http/423.d.ts +8 -0
- package/dist/http/423.js +18 -0
- package/dist/http/424.d.ts +8 -0
- package/dist/http/424.js +18 -0
- package/dist/http/425.d.ts +8 -0
- package/dist/http/425.js +18 -0
- package/dist/http/426.d.ts +8 -0
- package/dist/http/426.js +18 -0
- package/dist/http/428.d.ts +8 -0
- package/dist/http/428.js +18 -0
- package/dist/http/429.d.ts +8 -0
- package/dist/http/429.js +18 -0
- package/dist/http/431.d.ts +8 -0
- package/dist/http/431.js +18 -0
- package/dist/http/451.d.ts +8 -0
- package/dist/http/451.js +18 -0
- package/dist/http/500.d.ts +8 -0
- package/dist/http/500.js +18 -0
- package/dist/http/501.d.ts +8 -0
- package/dist/http/501.js +18 -0
- package/dist/http/502.d.ts +8 -0
- package/dist/http/502.js +18 -0
- package/dist/http/503.d.ts +8 -0
- package/dist/http/503.js +18 -0
- package/dist/http/504.d.ts +8 -0
- package/dist/http/504.js +18 -0
- package/dist/http/505.d.ts +8 -0
- package/dist/http/505.js +18 -0
- package/dist/http/506.d.ts +8 -0
- package/dist/http/506.js +18 -0
- package/dist/http/507.d.ts +8 -0
- package/dist/http/507.js +18 -0
- package/dist/http/508.d.ts +8 -0
- package/dist/http/508.js +18 -0
- package/dist/http/509.d.ts +8 -0
- package/dist/http/509.js +18 -0
- package/dist/http/510.d.ts +8 -0
- package/dist/http/510.js +18 -0
- package/dist/http/511.d.ts +8 -0
- package/dist/http/511.js +18 -0
- package/dist/http/http_error.d.ts +13 -0
- package/dist/http/http_error.js +16 -0
- package/dist/http/http_error_options.d.ts +10 -0
- package/dist/http/http_header.d.ts +6 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +52 -0
- package/package.json +52 -0
package/dist/http/403.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/403.ts
|
|
4
|
+
var ForbiddenError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 403;
|
|
7
|
+
const code = "FORBIDDEN";
|
|
8
|
+
message = message ?? "Forbidden";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ForbiddenError };
|
package/dist/http/404.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/404.ts
|
|
4
|
+
var NotFoundError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 404;
|
|
7
|
+
const code = "NOT_FOUND";
|
|
8
|
+
message = message ?? "Not Found";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { NotFoundError };
|
package/dist/http/405.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/405.ts
|
|
4
|
+
var MethodNotAllowedError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 405;
|
|
7
|
+
const code = "METHOD_NOT_ALLOWED";
|
|
8
|
+
message = message ?? "Method Not Allowed";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { MethodNotAllowedError };
|
package/dist/http/406.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/406.ts
|
|
4
|
+
var NotAcceptableError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 406;
|
|
7
|
+
const code = "NOT_ACCEPTABLE";
|
|
8
|
+
message = message ?? "Not Acceptable";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { NotAcceptableError };
|
package/dist/http/407.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/407.ts
|
|
4
|
+
var ProxyAuthenticationRequiredError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 407;
|
|
7
|
+
const code = "PROXY_AUTHENTICATION_REQUIRED";
|
|
8
|
+
message = message ?? "Proxy Authentication Required";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ProxyAuthenticationRequiredError };
|
package/dist/http/408.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/408.ts
|
|
4
|
+
var RequestTimeoutError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 408;
|
|
7
|
+
const code = "REQUEST_TIMEOUT";
|
|
8
|
+
message = message ?? "Request Timeout";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { RequestTimeoutError };
|
package/dist/http/409.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/409.ts
|
|
4
|
+
var ConflictError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 409;
|
|
7
|
+
const code = "CONFLICT";
|
|
8
|
+
message = message ?? "Conflict";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ConflictError };
|
package/dist/http/410.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/410.ts
|
|
4
|
+
var GoneError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 410;
|
|
7
|
+
const code = "GONE";
|
|
8
|
+
message = message ?? "Gone";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { GoneError };
|
package/dist/http/411.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/411.ts
|
|
4
|
+
var LengthRequiredError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 411;
|
|
7
|
+
const code = "LENGTH_REQUIRED";
|
|
8
|
+
message = message ?? "Length Required";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { LengthRequiredError };
|
package/dist/http/412.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/412.ts
|
|
4
|
+
var PreconditionFailedError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 412;
|
|
7
|
+
const code = "PRECONDITION_FAILED";
|
|
8
|
+
message = message ?? "Precondition Failed";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { PreconditionFailedError };
|
package/dist/http/413.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/413.ts
|
|
4
|
+
var PayloadTooLargeError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 413;
|
|
7
|
+
const code = "PAYLOAD_TOO_LARGE";
|
|
8
|
+
message = message ?? "Payload Too Large";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { PayloadTooLargeError };
|
package/dist/http/414.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/414.ts
|
|
4
|
+
var URITooLongError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 414;
|
|
7
|
+
const code = "URI_TOO_LONG";
|
|
8
|
+
message = message ?? "URI Too Long";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { URITooLongError };
|
package/dist/http/415.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/415.ts
|
|
4
|
+
var UnsupportedMediaTypeError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 415;
|
|
7
|
+
const code = "UNSUPPORTED_MEDIA_TYPE";
|
|
8
|
+
message = message ?? "Unsupported Media Type";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { UnsupportedMediaTypeError };
|
package/dist/http/416.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/416.ts
|
|
4
|
+
var RangeNotSatisfiableError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 416;
|
|
7
|
+
const code = "RANGE_NOT_SATISFIABLE";
|
|
8
|
+
message = message ?? "Range Not Satisfiable";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { RangeNotSatisfiableError };
|
package/dist/http/417.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/417.ts
|
|
4
|
+
var ExpectationFailedError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 417;
|
|
7
|
+
const code = "EXPECTATION_FAILED";
|
|
8
|
+
message = message ?? "Expectation Failed";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ExpectationFailedError };
|
package/dist/http/418.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/418.ts
|
|
4
|
+
var ImATeapotError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 418;
|
|
7
|
+
const code = "IMA_TEAPOT";
|
|
8
|
+
message = message ?? "I'm a teapot";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ImATeapotError };
|
package/dist/http/421.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/421.ts
|
|
4
|
+
var MisdirectedRequestError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 421;
|
|
7
|
+
const code = "MISDIRECTED_REQUEST";
|
|
8
|
+
message = message ?? "Misdirected Request";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { MisdirectedRequestError };
|
package/dist/http/422.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/422.ts
|
|
4
|
+
var UnprocessableEntityError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 422;
|
|
7
|
+
const code = "UNPROCESSABLE_ENTITY";
|
|
8
|
+
message = message ?? "Unprocessable Entity";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { UnprocessableEntityError };
|
package/dist/http/423.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/423.ts
|
|
4
|
+
var LockedError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 423;
|
|
7
|
+
const code = "LOCKED";
|
|
8
|
+
message = message ?? "Locked";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { LockedError };
|
package/dist/http/424.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/424.ts
|
|
4
|
+
var FailedDependencyError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 424;
|
|
7
|
+
const code = "FAILED_DEPENDENCY";
|
|
8
|
+
message = message ?? "Failed Dependency";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { FailedDependencyError };
|
package/dist/http/425.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/425.ts
|
|
4
|
+
var UnorderedCollectionError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 425;
|
|
7
|
+
const code = "UNORDERED_COLLECTION";
|
|
8
|
+
message = message ?? "Unordered Collection";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { UnorderedCollectionError };
|
package/dist/http/426.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpError } from "./http_error.js";
|
|
2
|
+
|
|
3
|
+
//#region src/http/426.ts
|
|
4
|
+
var UpgradeRequiredError = class extends HttpError {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
const status = 426;
|
|
7
|
+
const code = "UPGRADE_REQUIRED";
|
|
8
|
+
message = message ?? "Upgrade Required";
|
|
9
|
+
super({
|
|
10
|
+
code,
|
|
11
|
+
message,
|
|
12
|
+
status
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { UpgradeRequiredError };
|