2

I am working on an implementation for an existing public API. Now I needed to change the implementation to throw an exception for a failure condition about which previously the API consumer was not informed in any way.

So basically I added a new possible exception.

Is the addition of this exception an incompatible change, a compatible change, or even not a change to the public API at all?

I am asking this, because my API is versioned according to Semantic Versioning 2.0.0, and depending on this, I need to decide if I need to bump the major, minor, or the patch version component for this change.

EDIT

Here is some more background information: The API is used to allow a consumer to retrieve files from a shared file system. Upon retrieval the file is moved from an incoming directory into an archive. Previously, when the move failed, the API did not make this clear in any way. Now, this API is supposed to throw an exception in case the archival move operation failed. If the file stays in the incoming directory, the consequences can be severe, because the same file might be treated as new again and again until manual intervention.

The API is provided as an object to be interacted-with by Ruby programs.

aef
  • 331

1 Answers1

2

Looks like a potentially large change. It depends on the language/platform, but if you're using Java and you've added a checked exception, then your clients may not even be able to compile their code against your library without changes. Regardless of compilation issues, your library has a potential change in behaviour affecting the using code, and your clients should be aware of that.

Brian Agnew
  • 4,686