Skip to content

Commit 9b8e257

Browse files
committed
Add link to modern-errors-beautiful
1 parent d866e73 commit 9b8e257

File tree

5 files changed

+46
-0
lines changed

5 files changed

+46
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Stability:
3232

3333
- [`modern-errors-cli`](https://github.com/ehmicky/modern-errors-cli): Handle
3434
errors in CLI modules
35+
- [`modern-errors-beautiful`](https://github.com/ehmicky/modern-errors-beautiful):
36+
Prettify error messages and stacks
3537
- [`modern-errors-process`](https://github.com/ehmicky/modern-errors-process):
3638
Handle process errors
3739
- [`modern-errors-bugs`](https://github.com/ehmicky/modern-errors-bugs): Print

docs/plugins.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,9 @@ Some examples include:
623623
- [`modern-errors-cli`](https://github.com/ehmicky/modern-errors-cli)
624624
(underlying module:
625625
[`handle-cli-error`](https://github.com/ehmicky/handle-cli-error))
626+
- [`modern-errors-beautiful`](https://github.com/ehmicky/modern-errors-beautiful)
627+
(underlying module:
628+
[`beautiful-error`](https://github.com/ehmicky/beautiful-error))
626629
- [`modern-errors-serialize`](https://github.com/ehmicky/modern-errors-serialize)
627630
(underlying module:
628631
[`error-serializer`](https://github.com/ehmicky/error-serializer))

package-lock.json

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"@ehmicky/eslint-config": "^20.0.31",
7171
"@ehmicky/prettier-config": "^1.0.6",
7272
"is-error-instance": "^3.0.1",
73+
"modern-errors-beautiful": "^1.0.0",
7374
"modern-errors-bugs": "^5.0.1",
7475
"modern-errors-clean": "^6.0.1",
7576
"modern-errors-cli": "^5.0.1",

src/plugins/core/all.test-d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import ModernError, { type ErrorInstance } from 'modern-errors'
2+
import beautifulPlugin from 'modern-errors-beautiful'
23
import bugsPlugin from 'modern-errors-bugs'
34
import cleanPlugin from 'modern-errors-clean'
45
import cliPlugin from 'modern-errors-cli'
@@ -10,6 +11,7 @@ import winstonPlugin, { type Format } from 'modern-errors-winston'
1011
import { expectAssignable, expectType } from 'tsd'
1112

1213
const plugins = [
14+
beautifulPlugin,
1315
bugsPlugin,
1416
cleanPlugin,
1517
cliPlugin,
@@ -24,6 +26,7 @@ const error = new BaseError('')
2426

2527
ModernError.subclass('TestError', {
2628
plugins,
29+
beautiful: { icon: 'warning' },
2730
bugs: 'https://example.com',
2831
cli: { silent: true },
2932
http: { type: '' },
@@ -42,6 +45,8 @@ expectType<HttpResponse>(BaseError.httpResponse(error, { type: '' }))
4245
expectType<HttpResponse>(error.httpResponse({ type: '' }))
4346
expectType<void>(BaseError.exit(error, { silent: true }))
4447
expectType<void>(error.exit({ silent: true }))
48+
expectType<string>(BaseError.beautiful(error, { stack: true }))
49+
expectType<string>(error.beautiful({ stack: true }))
4550
const errorObject = BaseError.serialize(error)
4651
expectType<ErrorObject>(errorObject)
4752
expectType<ErrorObject>(error.toJSON())

0 commit comments

Comments
 (0)