Skip to content

DEBUG=+ breaks app #288

@radare

Description

@radare

By setting this value to the DEBUG environment variable, it generates an exception that can only be catched like this:

try {
  const debug = require('debug');
} catch (e) {
  console.log('Invalid DEBUG environment value');
}

this seems like an anti-pattern to me, so maybe .enable() should handle the exceptions in the RegExp construction and just not set any value in DEBUG.

is this expected behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions