Giter Club home page Giter Club logo

Comments (16)

czuczorf avatar czuczorf commented on May 24, 2024 2

I've found a work around about this, you can catch the error in res variable

  RestClient.Post<Info>(rh, new Info(), (err, res, body) =>
    {
        if (!String.IsNullOrEmpty(res.error))
        {
            Debug.Log("Errorr : " + res.error);

from restclient.

czuczorf avatar czuczorf commented on May 24, 2024 1

@jdnichollsc i've just tried running the latest release and run into this
https://github.com/proyecto26/RestClient/releases/download/1.2.1/RestClient.unitypackage

from restclient.

davidorbelian avatar davidorbelian commented on May 24, 2024 1

@jdnichollsc I've tried that with some public APIs as well as my own ASP.NET Core project. Looks like checking the error will be OK.

from restclient.

jdnichollsc avatar jdnichollsc commented on May 24, 2024 1

ok, let me fix that issue at night

from restclient.

jdnichollsc avatar jdnichollsc commented on May 24, 2024

@czuczorf ohh can you share a screenshot? I had not thought about that situation 😅

from restclient.

czuczorf avatar czuczorf commented on May 24, 2024

get_without_internet
post_without_internet
Thanks

from restclient.

jdnichollsc avatar jdnichollsc commented on May 24, 2024

yes, let me check in a moment. Thanks for notify this issue 👍

from restclient.

itsharshdeep avatar itsharshdeep commented on May 24, 2024

Hi, Thanks a lot for updating the package, but I believe the issue is still present, Get() is showing the no internet error but Post() is not showing the same. Post method is only showing the success. You can check the screenshot attached.
I have produced this bug with :

  1. After Disconnect the wifi
  2. Change the APIs address to something else

sucessmessage while internet off

from restclient.

jdnichollsc avatar jdnichollsc commented on May 24, 2024

Excellent, I need to add that validation with the promises 👍

from restclient.

jdnichollsc avatar jdnichollsc commented on May 24, 2024

I think the solution is modifying the following lines to validate if an error exist:

Example:

if (request.isDone && String.IsNullOrEmpty(res.error))

What do you think @czuczorf?
Let me know to publish a new release with that change :)

from restclient.

davidorbelian avatar davidorbelian commented on May 24, 2024

Hey. I accidentally wrote yesterday from the second, old account, I'm sorry.
Do you think it is enough to just check the res.error? May be also check for the status code to be "2xx"? What do you think @jdnichollsc?

from restclient.

jdnichollsc avatar jdnichollsc commented on May 24, 2024

@davidorbelian I don't know if validating by the status code is the correct way, because exist a lot of different status, or if validating by a range would be better... What do you think? 🤔

from restclient.

davidorbelian avatar davidorbelian commented on May 24, 2024

@jdnichollsc I will check today after work if checking error value is enough and post the results here.

from restclient.

jdnichollsc avatar jdnichollsc commented on May 24, 2024

@davidorbelian thanks for your help! 👍

from restclient.

jdnichollsc avatar jdnichollsc commented on May 24, 2024

Fixing this issue with the version 1.2.2

from restclient.

jdnichollsc avatar jdnichollsc commented on May 24, 2024

@czuczorf @davidorbelian @itsharshdeep check the last release and let me know! 👍 https://github.com/proyecto26/RestClient/releases/tag/1.2.2

from restclient.

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.