UnionType.ts: Improve error message on failed conversions.

Closes https://github.com/tridactyl/tridactyl/issues/1146.
This commit is contained in:
glacambre 2018-11-12 19:10:54 +01:00
parent 7c690d460a
commit dfbae7ed06
No known key found for this signature in database
GPG key ID: B9625DB1767553AC

View file

@ -24,10 +24,6 @@ export class UnionType implements Type {
return t.convert(argument)
} catch (e) {}
}
throw new Error(
`Can't convert argument to any of types: ${argument}, ${
this.types
}`,
)
throw new Error(`Can't convert "${argument}" to any of: ${this.types}`)
}
}