Giter VIP home page Giter VIP logo

Comments (8)

bchavez avatar bchavez commented on May 21, 2024 3

Originally, I kept them wrapped in AggregateException. But I had a change of heart ❤️ after thinking about it driving home. They are now unwrapped when used against the synchronous API and work as naturally expected in a synchronous world. Hehe.... catch that ? "a synchronous" 😎

from rethinkdb.driver.

bchavez avatar bchavez commented on May 21, 2024

Hey Oliver, how are you doing? Hope you're doing well. Sorry for the delayed response, still on vacation. Be back at work around April 25th or so. I'll try to answer as best I can. Thanks VERY much for the JSON traces -- they help a bunch.

First, it looks like you're using a Run Helper since the error message looks like:

The query response cannot be converted to an object of T or List<T>.
This run helper works with SUCCESS_ATOM results.....

Run Helpers aren't part of the official API, so I'm giving myself a little wiggle room here. 😉 😉 .

_I think_, what's happening here is { "t":18 is an error response from the server and the .RunHelper*<T> is expecting a non-error response so what you're getting instead is a ReqlDriverError because the .RunHelper can't magically convert an error response into a data response you request (possibly .RunResult).. IIRC, the Run Helpers don't do any checks for error responses instead they make a direct attempt to convert the JSON on the wire to the type you're expecting.

If you use the dynamic .Run method, you should get the expected exception you're looking for and error responses should line up with the Java driver.

Regardless, you bring up a good usability issue. We should probably check for error responses before attempting a direct Run Helper conversion.

Also, the core of the driver is async so the TPL/CLR will generate an AggregateException wrapping the underlying exception. I'm not sure what the official guidance is on unwrapping these exceptions for framework libraries. I don't have my reference books with me at the moment. I'll have to check when I get home.

Hope this helps,
Brian

from rethinkdb.driver.

oliverjanik avatar oliverjanik commented on May 21, 2024

Thanks for the response, yes I am using the non dynamic versions like RunResult or RunAtom. I prefer not to deal with dynamic unless absolutely necessary.

W.r.t AggregateException, I don't mind them if they're documented. I'm not sure if there's a standard practice for C# libraries, but dealing with actual exceptions is way more friendly.

from rethinkdb.driver.

bchavez avatar bchavez commented on May 21, 2024

Thanks again @oliverjanik. This is now fixed in master. Next release will contain the fix. We'll check and throw the response error for all Run Helpers before bottoming out with a ReqlDriverError in case of a mis-matched conversion.

from rethinkdb.driver.

oliverjanik avatar oliverjanik commented on May 21, 2024

Did you keep AggregateExceptions? Or do you unwrap them?

from rethinkdb.driver.

oliverjanik avatar oliverjanik commented on May 21, 2024

Any ETA on the release? Would make my life easier.

from rethinkdb.driver.

bchavez avatar bchavez commented on May 21, 2024

@oliverjanik v2.3.1-beta-1 released with changes thus far. Keyword: beta. There's some code reviewing in master that I still haven't finished. Also, have not tested new authentication in .NET Core yet.

from rethinkdb.driver.

oliverjanik avatar oliverjanik commented on May 21, 2024

OK, I'll give it a spin. Thank you very much.

from rethinkdb.driver.

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.