ashkan18 / graphlient

Ruby GraphQL Client
MIT License
251 stars 44 forks source link

Docs incorrectly state that Graphlient::Errors::TimeoutError does not inherit from Graphlient::Errors::ServerError #92

Open PhucNguyen1501 opened 2 years ago

PhucNguyen1501 commented 2 years ago

Describe the bug Graphlient::Errors::TimeoutError does not inherit from Graphlient::Errors::ServerError currently, hence inner_exception, status_code and response can't be called.

To Reproduce N/A

Expected behavior As per description, Graphlient::Errors::TimeoutError should inherit from Graphlient::Errors::ServerError.

Screenshots image image

According to source code, TimeoutError inherits from base Error currently

image

dblock commented 2 years ago

This is by design I believe. A timeout is a client-side timeout, and you never got a response from the server (so no response or status code to be had). I'll close, but feel free to convince me I'm wrong and we can reopen.

PhucNguyen1501 commented 2 years ago

This is by design I believe. A timeout is a client-side timeout, and you never got a response from the server (so no response or status code to be had). I'll close, but feel free to convince me I'm wrong and we can reopen.

Hi Daniel @dblock , If this is by design, can we please update the description? It is confusing to have the doc says otherwise.

I do agree that a timed out error should not inherit from the server error 😀

dblock commented 2 years ago

For sure @PhucNguyen1501! I see the problem now, I didn't pay attention to the description. I edited the title of this issue and reopened it. Care to PR?