Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add common exception class #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vladcostea
Copy link

  • Allows clients to rescue the common ServiceError class if they don't
    care what error the cmis service raised

- Allows clients to rescue the common ServiceError class if they don't
  care what error the cmis service raised
@@ -1,18 +1,19 @@
module CMIS
module Exceptions
InvalidArgument = Class.new(StandardError)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about ordering them alpabetically? Would make things more maintainable...

@@ -1,18 +1,19 @@
module CMIS
module Exceptions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of the exceptions module, it just adds complexity.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not, as this will surely break backwards compatibility with certain clients of this lib that rely on rescuing these exceptions.

Also, by removing the Exceptions namespace, assuming we still want to enforce a common parent class for all CMIS service related exceptions/errors, we would have to write CMIS::StorageException iso CMIS::Exceptions::Storage, which to me, is the same thing.

If you feel that strongly about removing the Exceptions namespace a compromise would be to introduce a new exception parent for each exception that sits between ServiceError and the exception.

For example

module CMIS
  ServiceError = Class.new(StandardError)
  StorageException = Class.new(ServiceError)
  module Exceptions
    Storage = Class.new(StorageException)
    ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants