-
Notifications
You must be signed in to change notification settings - Fork 72
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
Handle EADDRNOTAVAIL as a BaseConnectionError instead of SyscallError #98
Handle EADDRNOTAVAIL as a BaseConnectionError instead of SyscallError #98
Conversation
instead of letting EADDRNOTAVAIL be handled as a generic SyscallError convert it to a BaseConnectionError instead, in this case we treat it as a a TRILOGY_DNS_ERROR so that the activerecord adapters handle it as a DBConnectionError.
c3f6565
to
bcf974b
Compare
I'm not sure I agree with the motivation here. A Trilogy::SyscallError is what will be raised here and what we'll raise for a number of other connection-related errors. It seems best to use the most specific error we can for the error we've encountered. |
don't you think it would make sense to raise an exception that is derived from a In this case though I am not particularly invested anymore since it arises from an invalid system setup and thus is more of an outlier than other errors. |
I think it could make sense as a thoughts @adrianna-chang-shopify @casperisfine ? |
Yeah, that's why I don't like the syscall errors, I'd like to be able to |
Yeah, I guess the idea with our approach was that consumers could generically rescue syscall errors as |
closing in favour of #118 |
instead of letting EADDRNOTAVAIL be handled as a generic SyscallError convert it to a BaseConnectionError instead, in this case we treat it as a a TRILOGY_DNS_ERROR so that the activerecord adapters handle it as a DBConnectionError.
fixes trilogy-libraries/activerecord-trilogy-adapter#52