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

Error Handling #269

Closed
apneadiving opened this issue Oct 9, 2015 · 5 comments
Closed

Error Handling #269

apneadiving opened this issue Oct 9, 2015 · 5 comments

Comments

@apneadiving
Copy link
Contributor

In most places, errors are rescued and then a custom error is raised.

There the failure reason is sort of assumed based on the context but it could be wrong or not clear enough:

Example:

  rescue *rescuable_exceptions
    raise TenantNotFound, "The tenant #{tenant} cannot be found"
  end

There could be plenty of reasons there.

Could we pass the real error message instead of the custom one? eg:

  rescue *rescuable_exceptions => e
    raise TenantNotFound, e.message
  end
@bradrobertson
Copy link
Contributor

Ya but I'd like to keep the context of which tenant couldn't be found if we can incorporate that into the message.

@apneadiving
Copy link
Contributor Author

Ok, something like:

"Error while creating tenant #{ tenant_name }: #{ e.message }"

@bradrobertson
Copy link
Contributor

That depends if the error really was from creating or from switching to an unknown tenant. Those are two separate concepts. TenantNotFound is really that someone switched into an unknown tenant. Nothing to do with creation.

@apneadiving
Copy link
Contributor Author

Yes sure :)

Was jut meaning something like "Error while #{relevant action } on tenant #{ tenant_name }: #{ e.message }"

I'll change relevant action depending on the context

@bradrobertson
Copy link
Contributor

yup makes total sense!

bradrobertson added a commit that referenced this issue Nov 26, 2015
Custom connection options for tenants (basically to store on different servers) #264 #269 #270
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

No branches or pull requests

2 participants