Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Commit f969ff3

Browse files
committed
fix: only handle errors once
1 parent 11375af commit f969ff3

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export class Config extends Rx.Subject<ConfigMessage> {
2525
outputLevel: Levels = 'info'
2626
debug = process.env.DEBUG === '*'
2727
action: ActionBase = new Action()
28+
errorsHandled = false
2829

2930
get errlog(): string | undefined { return globals.errlog }
3031
set errlog(errlog: string | undefined) {

src/errors.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ export default function (o: Rx.Subject<Message>): Rx.Observable<any> {
7676
}
7777

7878
function handleUnhandleds() {
79+
if (config.errorsHandled) return
80+
config.errorsHandled = true
7981
process.once('SIGINT', () => {
8082
const cli = new CLI('SIGINT')
8183
const err: NodeJS.ErrnoException = new Error()

0 commit comments

Comments
 (0)