@betterer/errors
Advanced tools
Comparing version 3.1.1 to 4.0.0
@@ -6,2 +6,44 @@ # Change Log | ||
# [4.0.0](https://github.com/phenomnomnominal/betterer/compare/v3.1.2...v4.0.0) (2021-02-27) | ||
### Bug Fixes | ||
* **docs 📚:** restore header image ([#544](https://github.com/phenomnomnominal/betterer/issues/544)) ([e30a941](https://github.com/phenomnomnominal/betterer/commit/e30a941cc8badd79c4eaf505449ed56fda1be1bf)) | ||
### Code Refactoring | ||
* **betterer 🔧:** rewrite pretty much everything v4.0.0 ([#543](https://github.com/phenomnomnominal/betterer/issues/543)) ([48b85bd](https://github.com/phenomnomnominal/betterer/commit/48b85bd9482cb42673556917508ac741ab970587)), closes [#223](https://github.com/phenomnomnominal/betterer/issues/223) [#227](https://github.com/phenomnomnominal/betterer/issues/227) [#233](https://github.com/phenomnomnominal/betterer/issues/233) [#234](https://github.com/phenomnomnominal/betterer/issues/234) [#235](https://github.com/phenomnomnominal/betterer/issues/235) [#236](https://github.com/phenomnomnominal/betterer/issues/236) [#237](https://github.com/phenomnomnominal/betterer/issues/237) [#226](https://github.com/phenomnomnominal/betterer/issues/226) [#238](https://github.com/phenomnomnominal/betterer/issues/238) [#239](https://github.com/phenomnomnominal/betterer/issues/239) [#240](https://github.com/phenomnomnominal/betterer/issues/240) [#243](https://github.com/phenomnomnominal/betterer/issues/243) [#248](https://github.com/phenomnomnominal/betterer/issues/248) [#250](https://github.com/phenomnomnominal/betterer/issues/250) [#251](https://github.com/phenomnomnominal/betterer/issues/251) [#254](https://github.com/phenomnomnominal/betterer/issues/254) [#255](https://github.com/phenomnomnominal/betterer/issues/255) [#257](https://github.com/phenomnomnominal/betterer/issues/257) [#267](https://github.com/phenomnomnominal/betterer/issues/267) [#268](https://github.com/phenomnomnominal/betterer/issues/268) [#271](https://github.com/phenomnomnominal/betterer/issues/271) [#272](https://github.com/phenomnomnominal/betterer/issues/272) [#273](https://github.com/phenomnomnominal/betterer/issues/273) [#276](https://github.com/phenomnomnominal/betterer/issues/276) [#310](https://github.com/phenomnomnominal/betterer/issues/310) [#314](https://github.com/phenomnomnominal/betterer/issues/314) [#315](https://github.com/phenomnomnominal/betterer/issues/315) [#316](https://github.com/phenomnomnominal/betterer/issues/316) [#317](https://github.com/phenomnomnominal/betterer/issues/317) [#320](https://github.com/phenomnomnominal/betterer/issues/320) [#321](https://github.com/phenomnomnominal/betterer/issues/321) [#322](https://github.com/phenomnomnominal/betterer/issues/322) [#327](https://github.com/phenomnomnominal/betterer/issues/327) [#328](https://github.com/phenomnomnominal/betterer/issues/328) [#330](https://github.com/phenomnomnominal/betterer/issues/330) [#331](https://github.com/phenomnomnominal/betterer/issues/331) [#336](https://github.com/phenomnomnominal/betterer/issues/336) [#338](https://github.com/phenomnomnominal/betterer/issues/338) [#350](https://github.com/phenomnomnominal/betterer/issues/350) [#339](https://github.com/phenomnomnominal/betterer/issues/339) [#367](https://github.com/phenomnomnominal/betterer/issues/367) [#370](https://github.com/phenomnomnominal/betterer/issues/370) [#399](https://github.com/phenomnomnominal/betterer/issues/399) [#400](https://github.com/phenomnomnominal/betterer/issues/400) [#401](https://github.com/phenomnomnominal/betterer/issues/401) [#402](https://github.com/phenomnomnominal/betterer/issues/402) [#403](https://github.com/phenomnomnominal/betterer/issues/403) [#404](https://github.com/phenomnomnominal/betterer/issues/404) [#410](https://github.com/phenomnomnominal/betterer/issues/410) [#411](https://github.com/phenomnomnominal/betterer/issues/411) [#412](https://github.com/phenomnomnominal/betterer/issues/412) [#414](https://github.com/phenomnomnominal/betterer/issues/414) [#453](https://github.com/phenomnomnominal/betterer/issues/453) [#454](https://github.com/phenomnomnominal/betterer/issues/454) [#455](https://github.com/phenomnomnominal/betterer/issues/455) [#456](https://github.com/phenomnomnominal/betterer/issues/456) [#467](https://github.com/phenomnomnominal/betterer/issues/467) [#468](https://github.com/phenomnomnominal/betterer/issues/468) [#457](https://github.com/phenomnomnominal/betterer/issues/457) [#482](https://github.com/phenomnomnominal/betterer/issues/482) [#483](https://github.com/phenomnomnominal/betterer/issues/483) [#485](https://github.com/phenomnomnominal/betterer/issues/485) [#486](https://github.com/phenomnomnominal/betterer/issues/486) [#489](https://github.com/phenomnomnominal/betterer/issues/489) [#490](https://github.com/phenomnomnominal/betterer/issues/490) [#492](https://github.com/phenomnomnominal/betterer/issues/492) [#493](https://github.com/phenomnomnominal/betterer/issues/493) [#494](https://github.com/phenomnomnominal/betterer/issues/494) [#495](https://github.com/phenomnomnominal/betterer/issues/495) [#496](https://github.com/phenomnomnominal/betterer/issues/496) [#498](https://github.com/phenomnomnominal/betterer/issues/498) [#502](https://github.com/phenomnomnominal/betterer/issues/502) [#503](https://github.com/phenomnomnominal/betterer/issues/503) [#504](https://github.com/phenomnomnominal/betterer/issues/504) [#505](https://github.com/phenomnomnominal/betterer/issues/505) [#520](https://github.com/phenomnomnominal/betterer/issues/520) [#526](https://github.com/phenomnomnominal/betterer/issues/526) [#530](https://github.com/phenomnomnominal/betterer/issues/530) [#533](https://github.com/phenomnomnominal/betterer/issues/533) [#539](https://github.com/phenomnomnominal/betterer/issues/539) [#540](https://github.com/phenomnomnominal/betterer/issues/540) [#542](https://github.com/phenomnomnominal/betterer/issues/542) [#541](https://github.com/phenomnomnominal/betterer/issues/541) | ||
### BREAKING CHANGES | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
* chore(betterer 🕸): remove check for completed eslint rules | ||
* **betterer 🔧:** Changes to the public API | ||
* **betterer 🔧:** Changes to the public API | ||
## [3.1.1](https://github.com/phenomnomnominal/betterer/compare/v3.1.0...v3.1.1) (2020-10-29) | ||
@@ -8,0 +50,0 @@ |
import { BettererErrorDetails } from './types'; | ||
export declare class BettererError extends Error { | ||
code: symbol; | ||
details: BettererErrorDetails; | ||
constructor(code: symbol, ...details: BettererErrorDetails); | ||
isBettererError: boolean; | ||
constructor(message: string, ...details: BettererErrorDetails); | ||
} | ||
export declare function isBettererError(err: unknown): err is BettererError; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BettererError = void 0; | ||
var tslib_1 = require("tslib"); | ||
var BettererError = /** @class */ (function (_super) { | ||
tslib_1.__extends(BettererError, _super); | ||
function BettererError(code) { | ||
var _newTarget = this.constructor; | ||
var details = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
details[_i - 1] = arguments[_i]; | ||
} | ||
var _this = _super.call(this) || this; | ||
_this.code = code; | ||
Error.captureStackTrace(_this, BettererError); | ||
Object.setPrototypeOf(_this, _newTarget.prototype); | ||
_this.details = details; | ||
return _this; | ||
exports.isBettererError = exports.BettererError = void 0; | ||
class BettererError extends Error { | ||
constructor(message, ...details) { | ||
super(message); | ||
this.isBettererError = true; | ||
Error.captureStackTrace(this, BettererError); | ||
Object.setPrototypeOf(this, new.target.prototype); | ||
this.details = details; | ||
} | ||
return BettererError; | ||
}(Error)); | ||
} | ||
exports.BettererError = BettererError; | ||
function isBettererError(err) { | ||
return !!err.isBettererError; | ||
} | ||
exports.isBettererError = isBettererError; | ||
//# sourceMappingURL=error.js.map |
@@ -1,3 +0,2 @@ | ||
export { BettererError } from './error'; | ||
export { logError, registerError } from './error-handler'; | ||
export * from './types'; | ||
export { BettererError, isBettererError } from './error'; | ||
export { BettererErrorDetail, BettererErrorDetails } from './types'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.registerError = exports.logError = exports.BettererError = void 0; | ||
var tslib_1 = require("tslib"); | ||
exports.isBettererError = exports.BettererError = void 0; | ||
var error_1 = require("./error"); | ||
Object.defineProperty(exports, "BettererError", { enumerable: true, get: function () { return error_1.BettererError; } }); | ||
var error_handler_1 = require("./error-handler"); | ||
Object.defineProperty(exports, "logError", { enumerable: true, get: function () { return error_handler_1.logError; } }); | ||
Object.defineProperty(exports, "registerError", { enumerable: true, get: function () { return error_handler_1.registerError; } }); | ||
tslib_1.__exportStar(require("./types"), exports); | ||
Object.defineProperty(exports, "isBettererError", { enumerable: true, get: function () { return error_1.isBettererError; } }); | ||
//# sourceMappingURL=index.js.map |
import { BettererError } from './error'; | ||
export declare type BettererErrorDetails = ReadonlyArray<string | Error | BettererError>; | ||
export declare type BettererErrorFactory = (...details: BettererErrorDetails) => BettererError; | ||
export declare type BettererErrorMessageFactory = (...details: BettererErrorDetails) => string; | ||
export declare type ErrorLike = { | ||
message: string; | ||
stack: string; | ||
}; | ||
export declare type BettererErrorDetail = string | Error | BettererError; | ||
export declare type BettererErrorDetails = ReadonlyArray<BettererErrorDetail>; |
{ | ||
"name": "@betterer/errors", | ||
"description": "error handler for @betterer/betterer", | ||
"version": "3.1.1", | ||
"version": "4.0.0", | ||
"license": "MIT", | ||
@@ -24,8 +24,9 @@ "publishConfig": { | ||
"scripts": { | ||
"compile": "tsc -b ." | ||
"compile": "tsc -b .", | ||
"api": "ts-api-guardian --out ../../goldens/api/@betterer/errors.d.ts dist/index.d.ts" | ||
}, | ||
"dependencies": { | ||
"@betterer/logger": "^3.1.1" | ||
"engines": { | ||
"node": ">=12" | ||
}, | ||
"gitHead": "1367466c849e75733e87ce55c4e84e44a173324e" | ||
"gitHead": "e4068ade2596567bc53c6486280af3d882b40aa7" | ||
} |
@@ -1,2 +0,2 @@ | ||
[![Betterer](https://raw.githubusercontent.com/phenomnomnominal/betterer/master/docs/logo.png)](https://phenomnomnominal.github.io/betterer/) | ||
[![Betterer](https://raw.githubusercontent.com/phenomnomnominal/betterer/master/website/static/img/header.png)](https://phenomnomnominal.github.io/betterer/) | ||
@@ -7,30 +7,6 @@ # `@betterer/errors` | ||
Error handler used within [**`Betterer`**](https://github.com/phenomnomnominal/betterer). | ||
Error type used within [**`Betterer`**](https://github.com/phenomnomnominal/betterer). | ||
## Usage | ||
## Docs | ||
### Register Error | ||
Register an error type with the handler: | ||
```typescript | ||
import { registerError } from '@betterer/errors'; | ||
const MY_ERROR = registerError((details) => `Something went wrong: ${details}`); | ||
``` | ||
### Log Error | ||
Log a registered error type: | ||
```typescript | ||
import { logError, registerError } from '@betterer/errors'; | ||
const MY_ERROR = registerError(details => `Something went wrong: "${details}"`); | ||
try { | ||
throw MY_ERROR('OOPS!): | ||
} catch (e) { | ||
logError(e); // 'Something went wrong: "OOPS"' | ||
} | ||
``` | ||
[Check out the docs at `phenomnomnominal.github.io/betterer`! 🎉](https://phenomnomnominal.github.io/betterer/docs/error) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13292
0
13
37
12
- Removed@betterer/logger@^3.1.1
- Removed@babel/code-frame@7.26.2(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@betterer/logger@3.1.1(transitive)
- Removedansi-escapes@4.3.2(transitive)
- Removedansi-regex@2.1.15.0.1(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedaproba@1.2.0(transitive)
- Removedare-we-there-yet@1.1.7(transitive)
- Removedastral-regex@2.0.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedcli-cursor@3.1.0(transitive)
- Removedcode-point-at@1.1.0(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedconsole-control-strings@1.1.0(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removeddelegates@1.0.0(transitive)
- Removedemoji-regex@8.0.0(transitive)
- Removedgauge@2.7.4(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedhas-unicode@2.0.1(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-fullwidth-code-point@1.0.03.0.0(transitive)
- Removedisarray@1.0.0(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedlines-and-columns@1.2.4(transitive)
- Removedlog-update@4.0.0(transitive)
- Removedmimic-fn@2.1.0(transitive)
- Removednpmlog@4.1.2(transitive)
- Removednumber-is-nan@1.0.1(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedonetime@5.1.2(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedrestore-cursor@3.1.0(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedslice-ansi@4.0.0(transitive)
- Removedstring-width@1.0.24.2.3(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedstrip-ansi@3.0.16.0.1(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedtslib@2.8.1(transitive)
- Removedtype-fest@0.21.3(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwide-align@1.1.5(transitive)
- Removedwrap-ansi@6.2.0(transitive)