When a Bug Is Not a Bug

Posted on Sep 25, 2020

It is not uncommon for a bug to be raised that is not in fact a bug, but a feature request. Take for example OperationCanceledException should not be treated as an error #430. In this bug report jnm2 states that they believe the OperationCanceledException should be suppressed by the command line API library; their rationale being that other libraries often suppress this exception (this is somewhat amorphous as they give no concrete example). However, I agree with tmds' comment that this is not a decision that should be made at the API level, and that the existing infrastructure is sufficient.

Two options are provided:

  1. Use the existing exception handling infrastructure to suppress all OperationCancelledExceptions.
  2. Explicitly catch these exceptions where they are expected.

To suppress the exception by default would be a change to the current behaviour and may break existing code. To support existing code that expected to see the exception a new flag would need to be introduced in order to turn this new suppression behaviour off. That’s quite a lot of work for a feature that is of dubious value and can be supported (better) with the existing infrastructure. Exception suppression is almost always a bad idea as it can lead to confusing bugs in downstream code.

If I was a member of the project I would vote to close this issue as something that will not be implemented as it proposes a solution to a problem that does not exist and could only be implemented as part of a new major release.