Comments (8)
Originally, I kept them wrapped in AggregateException
. But I had a change of heart
from rethinkdb.driver.
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.
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.
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.
Did you keep AggregateExceptions? Or do you unwrap them?
from rethinkdb.driver.
Any ETA on the release? Would make my life easier.
from rethinkdb.driver.
@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.
OK, I'll give it a spin. Thank you very much.
from rethinkdb.driver.
Related Issues (20)
- Create a method to return result as raw json HOT 4
- Resolution function on OptArg insert conflict HOT 1
- ConnectionPool.Builder.ConnectAsync does not respect InitialTimeout() HOT 4
- Add Error codes to Exceptions HOT 2
- Additional exceptions thrown when trying to cancel Cursor.MoveNextAsync() HOT 6
- Object's primary key and key of RunAtom() is different (Client-side generation). HOT 4
- Support for System.Text.Json.JsonDocument
- Cursor<T> should implement IAsyncEnumerable<T> in .net core 3
- RethinkDB 2.4 Release
- Best options: RunResult, RunAtom or RunCursor HOT 3
- Get list from Table that contains 'A' in the 'message' field HOT 1
- ASL 2.0 HOT 1
- Implement lambda functions as a possible argument in Insert().OptArgs("conflict",...) HOT 1
- System.NullReferenceException HOT 1
- Add EntityFramework support to Linq provider HOT 5
- Polymorphism HOT 1
- Various exceptions when updating a document HOT 1
- System.Configuration.ConfigurationErrorsException: HOT 1
- Wrong OptArg serialisation after OrderBy
- Insert not working with RunNoReply & Can't use runOpts is always null -- solved
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rethinkdb.driver.