You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would like a way to throw ArguParseException, either directly or indirectly via a helper.
e.g. missingArg or invalidCommand of string -> 'a that would raise (ArguParseException("ERROR: " + message)) or similar
Expected behavior
Can handle 2% of cases where I determine that semantics have been contravened by the invocation, but can't represent that rule via attributes and/or Argu API calls
Actual behavior
Need to define my own exception for that, and then remember to handle it explicitly as I already need to for ArguParseException
Known workarounds
In Equinox, Propulsion and some closed source apps, I and others have established a convention of having a secondary exception (MissingArg)
I do appreciate that there is a value in ArguParseException being known and trusted to only be throwable indirectly by invoking Argu operations.
If the exception was a type rather than an exception, I'd be proposing a derived Exception type as a solution that solves my desire to be able to filter with a single type check pattern, but I suspect that's a bridge too far.
Am absolutely interested in spike PRs that demonstrate cleaner ways to handle cases where e.g. I'm seeking to convey programmatically that that some combination of arguments are missing and/or illegal.
Description
Would like a way to throw
ArguParseException
, either directly or indirectly via a helper.e.g.
missingArg
orinvalidCommand
ofstring -> 'a
that wouldraise (ArguParseException("ERROR: " + message))
or similarExpected behavior
Can handle 2% of cases where I determine that semantics have been contravened by the invocation, but can't represent that rule via attributes and/or Argu API calls
Actual behavior
Need to define my own exception for that, and then remember to handle it explicitly as I already need to for
ArguParseException
Known workarounds
In Equinox, Propulsion and some closed source apps, I and others have established a convention of having a secondary exception (
MissingArg
)The text was updated successfully, but these errors were encountered: