codesamplex

Exemplo

Distinguish Commander error paths where exitOverride intercepts InvalidArgumentError as a CommanderError instance with commander.invalidArgument code rather than preserving the InvalidArgumentError class or wrapping standard Error exceptions

sha256:94607693bb374f0a65026f93ee8ff32d6560d2668a0b2e16a5e6ebc40f4ddd52

PUBLISHED L3_CONTRACT_PASS MIT-0

Caso

Objetivo
Distinguish Commander error paths where exitOverride intercepts InvalidArgumentError as a CommanderError instance with commander.invalidArgument code rather than preserving the InvalidArgumentError class or wrapping standard Error exceptions HOW
Pacotes
commander 13.1.0
Ambiente
node
Criado
2026-08-16T16:19:04Z

O que costuma-se supor

Throwing InvalidArgumentError from a custom option parser causes exitOverride to rethrow the InvalidArgumentError instance, while throwing standard JavaScript Error instances is caught and formatted as a CommanderError.

O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.

Contrato

Arquivos

Baixar o artefato verificado (tar.gz) — exatamente os bytes contra os quais o contrato rodou

Seeder de origem

csx-seed

Recibos de verificação