Git Product home page Git Product logo

Comments (7)

michaelklishin avatar michaelklishin commented on July 30, 2024

Server logs would contain a very specific message when authentication fails.

Since every response in theory has access to the HTTP context, changing the API to include it makes some sense.
How many changes this would require given a specific HTTP client, I cannot immediately tell.

from hop.

acogoluegnes avatar acogoluegnes commented on July 30, 2024

I'll give a try because it's easy to test, but more information would be welcome: Hop version, a code snippet to reproduce (to find out which HTTP layer is used). Without this it's difficult to diagnose the problem. Thanks.

from hop.

acogoluegnes avatar acogoluegnes commented on July 30, 2024

The (default) HttpClient layer introduced in 4.0 would not handle errors properly for GET requests, I pushed a couple of changes to fix this. This is likely what you're were experiencing, but I'll wait your confirmation before releasing 4.1.

from hop.

Whitespirit0 avatar Whitespirit0 commented on July 30, 2024

Thanks for your reply and fixes. I'll get back to you next week.

from hop.

Whitespirit0 avatar Whitespirit0 commented on July 30, 2024

@acogoluegnes I've tested the authentication error and I can confirm that it's handled much better now.
I've also tested getting a non-existing queue and in this case I get null in return. From your commit, I see that the 404 code is handled specifically to return null but I'm wondering why. As a user I would have found it more helpful to have the exception with the status code like the other codes.

from hop.

acogoluegnes avatar acogoluegnes commented on July 30, 2024

Thanks for testing.

Returning null for non-existing resources is a historical design decision in Hop that was made before I started working on the library. Maybe @michaelklishin has more information about this.

I don't think it'll be easy to change this now, as it would be a significant breaking change.

from hop.

Whitespirit0 avatar Whitespirit0 commented on July 30, 2024

Ok I see, well it's not a big deal but something to be aware of to avoid NullPointerExceptions.

from hop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.