Return the enum name in errors
class Encoding extends Enum {
static 'utf-8' = 'UTF-8'
}
try {
Encoding.fromKey('UTF-8')
} catch (error) {
console.log(error.message) // Invalid Encoding key UTF-8
}
class Encoding extends Enum {
static 'utf-8' = 'UTF-8'
}
try {
Encoding.fromKey('UTF-8')
} catch (error) {
console.log(error.message) // Invalid Encoding key UTF-8
}