Code Monkey home page Code Monkey logo

Comments (7)

briancavalier avatar briancavalier commented on August 23, 2024

Hey @davidchase, are you using rest.js's error interceptor? By default, rest.js considers any response to be successful, so the promises it returns will always fulfill, unless you ues the error interceptor to define that 404 (or whatever codes you want/need) should represent a failure.

If you verify that the promise is rejecting and flatMapError still isn't kicking in, then we def need to dig deeper here. Let me know!

from most.

davidchase avatar davidchase commented on August 23, 2024

@briancavalier thanks for the quick reply
it seems like if i add rest.wrap(mime).wrap(errorCode);

I just get the one successful stream logging and the other logged message is Potentially unhandled rejection but no 'hello'

from most.

briancavalier avatar briancavalier commented on August 23, 2024

Thanks @davidchase. Seems like it could be a bug. I'll look into it!

from most.

briancavalier avatar briancavalier commented on August 23, 2024

Ok, yep, it's a (braindead!) bug in fromPromise. It isn't propagating an error when the promise rejects. I'll pull together a fix release asap, probably later tonight. Thanks for reporting this!

from most.

davidchase avatar davidchase commented on August 23, 2024

Thanks for looking into it 👍

from most.

briancavalier avatar briancavalier commented on August 23, 2024

Ok, fix for fromPromise (and unit test), is in master in c55c057. I still need to fix await as well.

from most.

briancavalier avatar briancavalier commented on August 23, 2024

In master, both fromPromise, and await should correctly handle rejected promises. Please try them out, and let me know if you run into any other issues.

I'll plan to do a release over the weekend. I had more plans for 0.11.0, but this is important enough to warrant releasing 0.11.0 now (rather than 0.10.3, since there have been some significant changes since 0.10.2). We can include the other upcoming new things in 0.12.0.

Thanks again, @davidchase!

from most.

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.