@eggjs/errors 3.0.0-beta.2 → 3.0.0-beta.29

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/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  Errors for [Egg.js](https://eggjs.org)
15
15
 
16
- egg-errors provide two kinds of errors that is Error and Exception.
16
+ `@eggjs/errors` provide two kinds of errors that is Error and Exception.
17
17
 
18
18
  - Exception is system error that egg will log an error and throw exception, but it will be catched by onerror plugin.
19
19
  - Error is business error that egg will transform it to response.
@@ -21,7 +21,7 @@ egg-errors provide two kinds of errors that is Error and Exception.
21
21
  ## Install
22
22
 
23
23
  ```bash
24
- $ npm i egg-errors --save
24
+ $ npm i @eggjs/errors --save
25
25
  ```
26
26
 
27
27
  ## Usage
@@ -29,7 +29,7 @@ $ npm i egg-errors --save
29
29
  Create an Error
30
30
 
31
31
  ```js
32
- const { EggError, EggException } = require('egg-errors');
32
+ const { EggError, EggException } = require('@eggjs/errors');
33
33
  let err = new EggError('egg error');
34
34
  console.log(EggError.getType(err)); // ERROR
35
35
  ```
@@ -55,7 +55,7 @@ console.log(EggError.getType(err)); // ERROR
55
55
  Error can be extendable.
56
56
 
57
57
  ```js
58
- const { EggBaseError } = require('egg-errors');
58
+ const { EggBaseError } = require('@eggjs/errors');
59
59
 
60
60
  class CustomError extends EggBaseError {
61
61
  constructor(message) {
@@ -67,11 +67,12 @@ class CustomError extends EggBaseError {
67
67
  or using typescript you can customize ErrorOptions.
68
68
 
69
69
  ```js
70
- import { EggBaseError, ErrorOptions } from 'egg-errors';
70
+ import { EggBaseError, ErrorOptions } from '@eggjs/errors';
71
71
 
72
72
  class CustomErrorOptions extends ErrorOptions {
73
73
  public data: object;
74
74
  }
75
+
75
76
  class CustomError extends EggBaseError<CustomErrorOptions> {
76
77
  public data: object;
77
78
  protected options: CustomErrorOptions;
@@ -83,14 +84,15 @@ class CustomError extends EggBaseError<CustomErrorOptions> {
83
84
  }
84
85
  ```
85
86
 
86
- Recommend use message instead of options in user land that it can be easily understood by developer, see [http error](https://github.com/eggjs/egg-errors/blob/master/lib/http/400.ts).
87
+ Recommend use message instead of options in user land that it can be easily understood by developer, see [http error](https://github.com/eggjs/egg/blob/master/packages/errors/src/http/400.ts).
87
88
 
88
89
  ### HTTP Errors
89
90
 
90
91
  HTTP Errors is BUILTIN errors that transform 400 ~ 500 status code to error objects. HttpError extends EggBaseError providing two properties which is `status` and `headers`;
91
92
 
92
93
  ```js
93
- const { ForbiddenError } = require('egg-errors');
94
+ const { ForbiddenError } = require('@eggjs/errors');
95
+
94
96
  const err = new ForbiddenError('your request is forbidden');
95
97
  console.log(err.status); // 403
96
98
  ```
@@ -98,7 +100,8 @@ console.log(err.status); // 403
98
100
  Support short name too:
99
101
 
100
102
  ```js
101
- const { E403 } = require('egg-errors');
103
+ const { E403 } = require('@eggjs/errors');
104
+
102
105
  const err = new E403('your request is forbidden');
103
106
  console.log(err.status); // 403
104
107
  ```
@@ -112,7 +115,7 @@ FrameworkBaseError extends EggBaseError providing three properties which is `mod
112
115
  FrameworkBaseError could not be used directly, framework/plugin should extends like this
113
116
 
114
117
  ```js
115
- const { FrameworkBaseError } = require('egg-errors');
118
+ const { FrameworkBaseError } = require('@eggjs/errors');
116
119
 
117
120
  class EggMysqlError extends FrameworkBaseError {
118
121
  // module should be implement
@@ -133,7 +136,7 @@ console.log(err.errorContext); // { traceId: 'xxx' }
133
136
  use the static method `.create(message: string, serialNumber: string | number, errorContext?: any)` to new a frameworkError and format it convenient
134
137
 
135
138
  ```js
136
- const { FrameworkBaseError } = require('egg-errors');
139
+ const { FrameworkBaseError } = require('@eggjs/errors');
137
140
 
138
141
  class EggMysqlError extends FrameworkBaseError {
139
142
  // module should be implement
@@ -152,10 +155,10 @@ framework.EggMysqlError: error message [ https://eggjs.org/zh-cn/faq/EGG_MYSQL/0
152
155
 
153
156
  FrameworkErrorFormater will append a faq guide url in error message.this would be helpful when developer encountered a framework error
154
157
 
155
- the faq guide url format: `${faqPrefix}/${err.module}/${err.serialNumber}`, `faqPrefix` is `https://eggjs.org/zh-cn/faq` by default. can be extendable or set `process.env.EGG_FRAMEWORK_ERR_FAQ_PERFIX` to override it.
158
+ the faq guide url format: `${faqPrefix}/${err.module}/${err.serialNumber}`, `faqPrefix` is `https://eggjs.org/zh-cn/faq` by default. It can be extended or overridden by setting `process.env.EGG_FRAMEWORK_ERR_FAQ_PREFIX` (recommended) or, for backward compatibility, `process.env.EGG_FRAMEWORK_ERR_FAQ_PERFIX` (legacy typo).
156
159
 
157
160
  ```js
158
- const { FrameworkErrorFormater } = require('egg-errors');
161
+ const { FrameworkErrorFormater } = require('@eggjs/errors');
159
162
 
160
163
  class CustomErrorFormatter extends FrameworkErrorFormater {
161
164
  static faqPrefix = 'http://www.custom.com/faq';
@@ -167,7 +170,7 @@ class CustomErrorFormatter extends FrameworkErrorFormater {
167
170
  format error to message, it will not effect origin error
168
171
 
169
172
  ```js
170
- const { FrameworkBaseError, FrameworkErrorFormater } = require('egg-errors');
173
+ const { FrameworkBaseError, FrameworkErrorFormater } = require('@eggjs/errors');
171
174
 
172
175
  class EggMysqlError extends FrameworkBaseError {
173
176
  // module should be implement
@@ -205,7 +208,7 @@ framework.EggMysqlError: error message [ http://www.custom.com/faq/EGG_MYSQL/01
205
208
  append faq guide url to err.message
206
209
 
207
210
  ```js
208
- const { FrameworkBaseError, FrameworkErrorFormater } = require('egg-errors');
211
+ const { FrameworkBaseError, FrameworkErrorFormater } = require('@eggjs/errors');
209
212
 
210
213
  class EggMysqlError extends FrameworkBaseError {
211
214
  // module should be implement
@@ -242,13 +245,8 @@ Please open an issue [here](https://github.com/eggjs/egg/issues?q=is%3Aissue+is%
242
245
 
243
246
  [MIT](LICENSE)
244
247
 
245
- <!-- GITCONTRIBUTOR_START -->
246
-
247
248
  ## Contributors
248
249
 
249
- | [<img src="https://avatars.githubusercontent.com/u/360661?v=4" width="100px;"/><br/><sub><b>popomore</b></sub>](https://github.com/popomore)<br/> | [<img src="https://avatars.githubusercontent.com/u/2160731?v=4" width="100px;"/><br/><sub><b>mansonchor</b></sub>](https://github.com/mansonchor)<br/> | [<img src="https://avatars.githubusercontent.com/u/156269?v=4" width="100px;"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/> | [<img src="https://avatars.githubusercontent.com/u/12657964?v=4" width="100px;"/><br/><sub><b>beliefgp</b></sub>](https://github.com/beliefgp)<br/> | [<img src="https://avatars.githubusercontent.com/u/19644997?v=4" width="100px;"/><br/><sub><b>sm2017</b></sub>](https://github.com/sm2017)<br/> |
250
- | :-----------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------: |
251
-
252
- This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Tue Feb 22 2022 11:32:47 GMT+0800`.
250
+ [![Contributors](https://contrib.rocks/image?repo=eggjs/egg)](https://github.com/eggjs/egg/graphs/contributors)
253
251
 
254
- <!-- GITCONTRIBUTOR_END -->
252
+ Made with [contributors-img](https://contrib.rocks).
package/dist/base.d.ts CHANGED
@@ -1,18 +1,16 @@
1
- import { ErrorOptions } from "./error_options.js";
2
1
  import { ErrorType } from "./error_type.js";
2
+ import { ErrorOptions } from "./error_options.js";
3
3
 
4
4
  //#region src/base.d.ts
5
- declare const TYPE: symbol;
6
5
  declare class BaseError<T extends ErrorOptions> extends Error {
7
- [TYPE]?: ErrorType | undefined;
8
6
  [key: string]: any;
9
7
  static getType(err: Error): ErrorType;
10
8
  /**
11
- * Create a new instance of the error class from an existing error
12
- * @param err - The error to create a new instance from
13
- * @param args - The arguments to pass to the constructor
14
- * @returns A new instance of the error class
15
- */
9
+ * Create a new instance of the error class from an existing error
10
+ * @param err - The error to create a new instance from
11
+ * @param args - The arguments to pass to the constructor
12
+ * @returns A new instance of the error class
13
+ */
16
14
  static from<S extends new (...args: any) => InstanceType<typeof BaseError>, P extends ConstructorParameters<S>>(this: S, err: Error, ...args: P | undefined[]): InstanceType<S>;
17
15
  code: string;
18
16
  protected options: T;
package/dist/base.js CHANGED
@@ -3,7 +3,6 @@ import { ErrorType } from "./error_type.js";
3
3
  //#region src/base.ts
4
4
  const TYPE = Symbol.for("BaseError#type");
5
5
  var BaseError = class extends Error {
6
- [TYPE];
7
6
  static getType(err) {
8
7
  return err[TYPE] ?? ErrorType.BUILTIN;
9
8
  }
@@ -28,8 +27,9 @@ var BaseError = class extends Error {
28
27
  this.message = this.options.message ?? "";
29
28
  this.code = this.options.code ?? "";
30
29
  this.name = this.constructor.name;
30
+ if (this.options.errorType) this[TYPE] = this.options.errorType;
31
31
  }
32
32
  };
33
33
 
34
34
  //#endregion
35
- export { BaseError, TYPE };
35
+ export { BaseError };
@@ -1,11 +1,13 @@
1
1
  import { ErrorType } from "./error_type.js";
2
- import { BaseError, TYPE } from "./base.js";
2
+ import { BaseError } from "./base.js";
3
3
 
4
4
  //#region src/base_error.ts
5
5
  var EggBaseError = class extends BaseError {
6
6
  constructor(options) {
7
- super(options);
8
- this[TYPE] = ErrorType.ERROR;
7
+ super({
8
+ ...options,
9
+ errorType: ErrorType.ERROR
10
+ });
9
11
  }
10
12
  };
11
13
 
@@ -2,7 +2,7 @@ import { ErrorOptions } from "./error_options.js";
2
2
  import { BaseError } from "./base.js";
3
3
 
4
4
  //#region src/base_exception.d.ts
5
- declare class EggBaseException<T extends ErrorOptions> extends BaseError<T> {
5
+ declare class EggBaseException<T extends ErrorOptions = ErrorOptions> extends BaseError<T> {
6
6
  constructor(options?: T);
7
7
  }
8
8
  //#endregion
@@ -1,11 +1,13 @@
1
1
  import { ErrorType } from "./error_type.js";
2
- import { BaseError, TYPE } from "./base.js";
2
+ import { BaseError } from "./base.js";
3
3
 
4
4
  //#region src/base_exception.ts
5
5
  var EggBaseException = class extends BaseError {
6
6
  constructor(options) {
7
- super(options);
8
- this[TYPE] = ErrorType.EXCEPTION;
7
+ super({
8
+ errorType: ErrorType.EXCEPTION,
9
+ ...options
10
+ });
9
11
  }
10
12
  };
11
13
 
@@ -1,6 +1,9 @@
1
+ import { ErrorType } from "./error_type.js";
2
+
1
3
  //#region src/error_options.d.ts
2
- declare class ErrorOptions {
4
+ interface ErrorOptions {
3
5
  code?: string;
6
+ errorType?: ErrorType;
4
7
  message: string;
5
8
  [key: string]: any;
6
9
  }
@@ -1,16 +1,16 @@
1
1
  //#region src/error_type.d.ts
2
2
  declare const ErrorType: {
3
3
  /**
4
- * Built-in Error
5
- */
4
+ * Built-in Error
5
+ */
6
6
  readonly BUILTIN: "BUILTIN";
7
7
  /**
8
- * Egg Error
9
- */
8
+ * Egg Error
9
+ */
10
10
  readonly ERROR: "ERROR";
11
11
  /**
12
- * Egg Exception
13
- */
12
+ * Egg Exception
13
+ */
14
14
  readonly EXCEPTION: "EXCEPTION";
15
15
  };
16
16
  type ErrorType = (typeof ErrorType)[keyof typeof ErrorType];
@@ -1,8 +1,7 @@
1
- import { ErrorOptions } from "./error_options.js";
2
1
  import { EggBaseException } from "./base_exception.js";
3
2
 
4
3
  //#region src/exception.d.ts
5
- declare class EggException extends EggBaseException<ErrorOptions> {
4
+ declare class EggException extends EggBaseException {
6
5
  constructor(message?: string);
7
6
  }
8
7
  //#endregion
@@ -1,12 +1,12 @@
1
1
  //#region src/framework/formatter.d.ts
2
- declare class FrameworkErrorFormater {
2
+ declare class FrameworkErrorFormatter {
3
3
  protected static faqPrefix: string;
4
4
  /**
5
- * Custom framework error FAQ prefix
6
- */
5
+ * Custom framework error FAQ prefix
6
+ */
7
7
  private static faqPrefixEnv;
8
8
  static format(err: Error): string;
9
9
  static formatError<T extends Error>(err: T): T;
10
10
  }
11
11
  //#endregion
12
- export { FrameworkErrorFormater };
12
+ export { FrameworkErrorFormatter };
@@ -4,12 +4,12 @@ import os from "node:os";
4
4
 
5
5
  //#region src/framework/formatter.ts
6
6
  const hostname = os.hostname();
7
- var FrameworkErrorFormater = class {
7
+ var FrameworkErrorFormatter = class {
8
8
  static faqPrefix = "https://eggjs.org/zh-cn/faq";
9
9
  /**
10
10
  * Custom framework error FAQ prefix
11
11
  */
12
- static faqPrefixEnv = process.env.EGG_FRAMEWORK_ERR_FAQ_PERFIX;
12
+ static faqPrefixEnv = process.env.EGG_FRAMEWORK_ERR_FAQ_PREFIX ?? process.env.EGG_FRAMEWORK_ERR_FAQ_PERFIX;
13
13
  static format(err) {
14
14
  const faqPrefix = this.faqPrefixEnv ?? this.faqPrefix;
15
15
  let errMessage = err.message;
@@ -25,4 +25,4 @@ var FrameworkErrorFormater = class {
25
25
  };
26
26
 
27
27
  //#endregion
28
- export { FrameworkErrorFormater };
28
+ export { FrameworkErrorFormatter };
@@ -1,5 +1,5 @@
1
1
  import { EggBaseError } from "../base_error.js";
2
- import { FrameworkErrorFormater } from "./formatter.js";
2
+ import { FrameworkErrorFormatter } from "./formatter.js";
3
3
  import assert from "node:assert";
4
4
 
5
5
  //#region src/framework/framework_base_error.ts
@@ -8,7 +8,7 @@ var FrameworkBaseError = class extends EggBaseError {
8
8
  serialNumber;
9
9
  errorContext;
10
10
  get module() {
11
- throw new Error("module should be implement");
11
+ throw new Error("module should be implemented");
12
12
  }
13
13
  constructor(message, serialNumber, errorContext) {
14
14
  super({
@@ -24,7 +24,7 @@ var FrameworkBaseError = class extends EggBaseError {
24
24
  this[FRAMEWORK_ERROR_SYMBOL] = true;
25
25
  }
26
26
  static create(message, serialNumber, errorContext) {
27
- const err = FrameworkErrorFormater.formatError(new this(message, serialNumber, errorContext));
27
+ const err = FrameworkErrorFormatter.formatError(new this(message, serialNumber, errorContext));
28
28
  Error.captureStackTrace(err, this.create);
29
29
  return err;
30
30
  }
@@ -6,7 +6,6 @@ var HttpError = class extends EggBaseError {
6
6
  headers;
7
7
  constructor(options) {
8
8
  super(options);
9
- this.headers = {};
10
9
  this.status = this.options.status;
11
10
  this.headers = this.options.headers ?? {};
12
11
  }
@@ -2,7 +2,7 @@ import { ErrorOptions } from "../error_options.js";
2
2
  import { HttpHeader } from "./http_header.js";
3
3
 
4
4
  //#region src/http/http_error_options.d.ts
5
- declare class HttpErrorOptions extends ErrorOptions {
5
+ interface HttpErrorOptions extends ErrorOptions {
6
6
  status: number;
7
7
  headers?: HttpHeader;
8
8
  }
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { ErrorOptions } from "./error_options.js";
2
1
  import { ErrorType } from "./error_type.js";
2
+ import { ErrorOptions } from "./error_options.js";
3
3
  import { EggBaseError } from "./base_error.js";
4
4
  import { EggBaseException } from "./base_exception.js";
5
5
  import { EggError } from "./error.js";
6
6
  import { EggException } from "./exception.js";
7
7
  import { FRAMEWORK_ERROR_SYMBOL, FrameworkBaseError } from "./framework/framework_base_error.js";
8
- import { FrameworkErrorFormater } from "./framework/formatter.js";
8
+ import { FrameworkErrorFormatter } from "./framework/formatter.js";
9
9
  import { HttpError } from "./http/http_error.js";
10
10
  import { BadRequestError } from "./http/400.js";
11
11
  import { UnauthorizedError } from "./http/401.js";
@@ -48,4 +48,4 @@ import { LoopDetectedError } from "./http/508.js";
48
48
  import { BandwidthLimitExceededError } from "./http/509.js";
49
49
  import { NotExtendedError } from "./http/510.js";
50
50
  import { NetworkAuthenticationRequiredError } from "./http/511.js";
51
- export { BadGatewayError, BadRequestError, BandwidthLimitExceededError, ConflictError, BadRequestError as E400, UnauthorizedError as E401, PaymentRequiredError as E402, ForbiddenError as E403, NotFoundError as E404, MethodNotAllowedError as E405, NotAcceptableError as E406, ProxyAuthenticationRequiredError as E407, RequestTimeoutError as E408, ConflictError as E409, GoneError as E410, LengthRequiredError as E411, PreconditionFailedError as E412, PayloadTooLargeError as E413, URITooLongError as E414, UnsupportedMediaTypeError as E415, RangeNotSatisfiableError as E416, ExpectationFailedError as E417, ImATeapotError as E418, MisdirectedRequestError as E421, UnprocessableEntityError as E422, LockedError as E423, FailedDependencyError as E424, UnorderedCollectionError as E425, UpgradeRequiredError as E426, PreconditionRequiredError as E428, TooManyRequestsError as E429, RequestHeaderFieldsTooLargeError as E431, UnavailableForLegalReasonsError as E451, InternalServerError as E500, NotImplementedError as E501, BadGatewayError as E502, ServiceUnavailableError as E503, GatewayTimeoutError as E504, HTTPVersionNotSupportedError as E505, VariantAlsoNegotiatesError as E506, InsufficientStorageError as E507, LoopDetectedError as E508, BandwidthLimitExceededError as E509, NotExtendedError as E510, NetworkAuthenticationRequiredError as E511, EggBaseError, EggBaseException, EggError, EggException, ErrorOptions, ErrorType, ExpectationFailedError, FRAMEWORK_ERROR_SYMBOL, FailedDependencyError, ForbiddenError, FrameworkBaseError, FrameworkErrorFormater, GatewayTimeoutError, GoneError, HTTPVersionNotSupportedError, HttpError, ImATeapotError, InsufficientStorageError, InternalServerError, LengthRequiredError, LockedError, LoopDetectedError, MethodNotAllowedError, MisdirectedRequestError, NetworkAuthenticationRequiredError, NotAcceptableError, NotExtendedError, NotFoundError, NotImplementedError, PayloadTooLargeError, PaymentRequiredError, PreconditionFailedError, PreconditionRequiredError, ProxyAuthenticationRequiredError, RangeNotSatisfiableError, RequestHeaderFieldsTooLargeError, RequestTimeoutError, ServiceUnavailableError, TooManyRequestsError, URITooLongError, UnauthorizedError, UnavailableForLegalReasonsError, UnorderedCollectionError, UnprocessableEntityError, UnsupportedMediaTypeError, UpgradeRequiredError, VariantAlsoNegotiatesError };
51
+ export { BadGatewayError, BadRequestError, BandwidthLimitExceededError, ConflictError, BadRequestError as E400, UnauthorizedError as E401, PaymentRequiredError as E402, ForbiddenError as E403, NotFoundError as E404, MethodNotAllowedError as E405, NotAcceptableError as E406, ProxyAuthenticationRequiredError as E407, RequestTimeoutError as E408, ConflictError as E409, GoneError as E410, LengthRequiredError as E411, PreconditionFailedError as E412, PayloadTooLargeError as E413, URITooLongError as E414, UnsupportedMediaTypeError as E415, RangeNotSatisfiableError as E416, ExpectationFailedError as E417, ImATeapotError as E418, MisdirectedRequestError as E421, UnprocessableEntityError as E422, LockedError as E423, FailedDependencyError as E424, UnorderedCollectionError as E425, UpgradeRequiredError as E426, PreconditionRequiredError as E428, TooManyRequestsError as E429, RequestHeaderFieldsTooLargeError as E431, UnavailableForLegalReasonsError as E451, InternalServerError as E500, NotImplementedError as E501, BadGatewayError as E502, ServiceUnavailableError as E503, GatewayTimeoutError as E504, HTTPVersionNotSupportedError as E505, VariantAlsoNegotiatesError as E506, InsufficientStorageError as E507, LoopDetectedError as E508, BandwidthLimitExceededError as E509, NotExtendedError as E510, NetworkAuthenticationRequiredError as E511, EggBaseError, EggBaseException, EggError, EggException, ErrorOptions, ErrorType, ExpectationFailedError, FRAMEWORK_ERROR_SYMBOL, FailedDependencyError, ForbiddenError, FrameworkBaseError, FrameworkErrorFormatter as FrameworkErrorFormater, FrameworkErrorFormatter, GatewayTimeoutError, GoneError, HTTPVersionNotSupportedError, HttpError, ImATeapotError, InsufficientStorageError, InternalServerError, LengthRequiredError, LockedError, LoopDetectedError, MethodNotAllowedError, MisdirectedRequestError, NetworkAuthenticationRequiredError, NotAcceptableError, NotExtendedError, NotFoundError, NotImplementedError, PayloadTooLargeError, PaymentRequiredError, PreconditionFailedError, PreconditionRequiredError, ProxyAuthenticationRequiredError, RangeNotSatisfiableError, RequestHeaderFieldsTooLargeError, RequestTimeoutError, ServiceUnavailableError, TooManyRequestsError, URITooLongError, UnauthorizedError, UnavailableForLegalReasonsError, UnorderedCollectionError, UnprocessableEntityError, UnsupportedMediaTypeError, UpgradeRequiredError, VariantAlsoNegotiatesError };
package/dist/index.js CHANGED
@@ -1,10 +1,9 @@
1
- import { ErrorOptions } from "./error_options.js";
2
1
  import { ErrorType } from "./error_type.js";
3
2
  import { EggBaseError } from "./base_error.js";
4
3
  import { EggBaseException } from "./base_exception.js";
5
4
  import { EggError } from "./error.js";
6
5
  import { EggException } from "./exception.js";
7
- import { FrameworkErrorFormater } from "./framework/formatter.js";
6
+ import { FrameworkErrorFormatter } from "./framework/formatter.js";
8
7
  import { FRAMEWORK_ERROR_SYMBOL, FrameworkBaseError } from "./framework/framework_base_error.js";
9
8
  import { HttpError } from "./http/http_error.js";
10
9
  import { BadRequestError } from "./http/400.js";
@@ -49,4 +48,4 @@ import { BandwidthLimitExceededError } from "./http/509.js";
49
48
  import { NotExtendedError } from "./http/510.js";
50
49
  import { NetworkAuthenticationRequiredError } from "./http/511.js";
51
50
 
52
- export { BadGatewayError, BadRequestError, BandwidthLimitExceededError, ConflictError, BadRequestError as E400, UnauthorizedError as E401, PaymentRequiredError as E402, ForbiddenError as E403, NotFoundError as E404, MethodNotAllowedError as E405, NotAcceptableError as E406, ProxyAuthenticationRequiredError as E407, RequestTimeoutError as E408, ConflictError as E409, GoneError as E410, LengthRequiredError as E411, PreconditionFailedError as E412, PayloadTooLargeError as E413, URITooLongError as E414, UnsupportedMediaTypeError as E415, RangeNotSatisfiableError as E416, ExpectationFailedError as E417, ImATeapotError as E418, MisdirectedRequestError as E421, UnprocessableEntityError as E422, LockedError as E423, FailedDependencyError as E424, UnorderedCollectionError as E425, UpgradeRequiredError as E426, PreconditionRequiredError as E428, TooManyRequestsError as E429, RequestHeaderFieldsTooLargeError as E431, UnavailableForLegalReasonsError as E451, InternalServerError as E500, NotImplementedError as E501, BadGatewayError as E502, ServiceUnavailableError as E503, GatewayTimeoutError as E504, HTTPVersionNotSupportedError as E505, VariantAlsoNegotiatesError as E506, InsufficientStorageError as E507, LoopDetectedError as E508, BandwidthLimitExceededError as E509, NotExtendedError as E510, NetworkAuthenticationRequiredError as E511, EggBaseError, EggBaseException, EggError, EggException, ErrorOptions, ErrorType, ExpectationFailedError, FRAMEWORK_ERROR_SYMBOL, FailedDependencyError, ForbiddenError, FrameworkBaseError, FrameworkErrorFormater, GatewayTimeoutError, GoneError, HTTPVersionNotSupportedError, HttpError, ImATeapotError, InsufficientStorageError, InternalServerError, LengthRequiredError, LockedError, LoopDetectedError, MethodNotAllowedError, MisdirectedRequestError, NetworkAuthenticationRequiredError, NotAcceptableError, NotExtendedError, NotFoundError, NotImplementedError, PayloadTooLargeError, PaymentRequiredError, PreconditionFailedError, PreconditionRequiredError, ProxyAuthenticationRequiredError, RangeNotSatisfiableError, RequestHeaderFieldsTooLargeError, RequestTimeoutError, ServiceUnavailableError, TooManyRequestsError, URITooLongError, UnauthorizedError, UnavailableForLegalReasonsError, UnorderedCollectionError, UnprocessableEntityError, UnsupportedMediaTypeError, UpgradeRequiredError, VariantAlsoNegotiatesError };
51
+ export { BadGatewayError, BadRequestError, BandwidthLimitExceededError, ConflictError, BadRequestError as E400, UnauthorizedError as E401, PaymentRequiredError as E402, ForbiddenError as E403, NotFoundError as E404, MethodNotAllowedError as E405, NotAcceptableError as E406, ProxyAuthenticationRequiredError as E407, RequestTimeoutError as E408, ConflictError as E409, GoneError as E410, LengthRequiredError as E411, PreconditionFailedError as E412, PayloadTooLargeError as E413, URITooLongError as E414, UnsupportedMediaTypeError as E415, RangeNotSatisfiableError as E416, ExpectationFailedError as E417, ImATeapotError as E418, MisdirectedRequestError as E421, UnprocessableEntityError as E422, LockedError as E423, FailedDependencyError as E424, UnorderedCollectionError as E425, UpgradeRequiredError as E426, PreconditionRequiredError as E428, TooManyRequestsError as E429, RequestHeaderFieldsTooLargeError as E431, UnavailableForLegalReasonsError as E451, InternalServerError as E500, NotImplementedError as E501, BadGatewayError as E502, ServiceUnavailableError as E503, GatewayTimeoutError as E504, HTTPVersionNotSupportedError as E505, VariantAlsoNegotiatesError as E506, InsufficientStorageError as E507, LoopDetectedError as E508, BandwidthLimitExceededError as E509, NotExtendedError as E510, NetworkAuthenticationRequiredError as E511, EggBaseError, EggBaseException, EggError, EggException, ErrorType, ExpectationFailedError, FRAMEWORK_ERROR_SYMBOL, FailedDependencyError, ForbiddenError, FrameworkBaseError, FrameworkErrorFormatter as FrameworkErrorFormater, FrameworkErrorFormatter, GatewayTimeoutError, GoneError, HTTPVersionNotSupportedError, HttpError, ImATeapotError, InsufficientStorageError, InternalServerError, LengthRequiredError, LockedError, LoopDetectedError, MethodNotAllowedError, MisdirectedRequestError, NetworkAuthenticationRequiredError, NotAcceptableError, NotExtendedError, NotFoundError, NotImplementedError, PayloadTooLargeError, PaymentRequiredError, PreconditionFailedError, PreconditionRequiredError, ProxyAuthenticationRequiredError, RangeNotSatisfiableError, RequestHeaderFieldsTooLargeError, RequestTimeoutError, ServiceUnavailableError, TooManyRequestsError, URITooLongError, UnauthorizedError, UnavailableForLegalReasonsError, UnorderedCollectionError, UnprocessableEntityError, UnsupportedMediaTypeError, UpgradeRequiredError, VariantAlsoNegotiatesError };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eggjs/errors",
3
- "version": "3.0.0-beta.2",
4
- "description": "egg-errors provide two kinds of errors that is Error and Exception.",
3
+ "version": "3.0.0-beta.29",
4
+ "description": "@eggjs/errors provide two kinds of errors that is Error and Exception.",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./dist/index.js",
@@ -29,12 +29,12 @@
29
29
  },
30
30
  "dependencies": {},
31
31
  "devDependencies": {
32
- "@types/node": "^24.6.2",
33
- "oxlint": "^1.19.0",
34
- "tsdown": "^0.15.4",
32
+ "@types/node": "^24.8.1",
33
+ "oxlint": "^1.23.0",
34
+ "tsdown": "0.15.6",
35
35
  "typescript": "^5.9.3",
36
- "vitest": "4.0.0-beta.16",
37
- "@eggjs/tsconfig": "3.1.0-beta.27"
36
+ "vitest": "4.0.0-beta.18",
37
+ "@eggjs/tsconfig": "3.1.0-beta.29"
38
38
  },
39
39
  "main": "./dist/index.js",
40
40
  "module": "./dist/index.js",
@@ -1,8 +0,0 @@
1
- //#region src/error_options.ts
2
- var ErrorOptions = class {
3
- code;
4
- message;
5
- };
6
-
7
- //#endregion
8
- export { ErrorOptions };