mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-09 04:14:15 +00:00
Improve handling of oclif parser errors.
Change-type: patch Signed-off-by: Scott Lowe <scott@balena.io>
This commit is contained in:
parent
7d2e32777f
commit
5b5f258685
@ -137,9 +137,11 @@ const EXPECTED_ERROR_REGEXES = [
|
||||
/^BalenaDeviceNotFound/, // balena-sdk
|
||||
/^BalenaExpiredToken/, // balena-sdk
|
||||
/^Missing \w+$/, // Capitano,
|
||||
/^Missing \d+ required arg/, // oclif parser: RequiredArgsError, RequiredFlagError
|
||||
/^Missing \d+ required arg/, // oclif parser: RequiredArgsError
|
||||
/Missing required flag/, // oclif parser: RequiredFlagError
|
||||
/^Unexpected argument/, // oclif parser: UnexpectedArgsError
|
||||
/to be one of/, // oclif parser: FlagInvalidOptionError, ArgInvalidOptionError
|
||||
/must also be provided when using/, // oclif parser (depends-on)
|
||||
];
|
||||
|
||||
// Support unit testing of handleError
|
||||
|
@ -120,9 +120,11 @@ describe('handleError() function', () => {
|
||||
'Missing uuid', // Capitano
|
||||
'Missing 1 required argument', // oclif
|
||||
'Missing 2 required arguments', // oclif
|
||||
'Unexpected argument',
|
||||
'Unexpected arguments',
|
||||
'to be one of',
|
||||
'Missing required flag', // oclif
|
||||
'Unexpected argument', // oclif
|
||||
'Unexpected arguments', // oclif
|
||||
'to be one of', // oclif
|
||||
'must also be provided when using', // oclif
|
||||
];
|
||||
|
||||
messagesToMatch.forEach((message) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user