Giter Club home page Giter Club logo

Comments (2)

bchavez avatar bchavez commented on June 1, 2024

Exceptions like ReqlOpFailedError are built into the protocol. If the protocol doesn't provide an error code, the driver can't provide one either.

public virtual ReqlError Build()
{
ReqlError con;
switch( ResponseType )
{
case Proto.ResponseType.CLIENT_ERROR:
con = new ReqlClientError(Msg);
break;
case Proto.ResponseType.COMPILE_ERROR:
con = new ReqlServerCompileError(Msg);
break;
case Proto.ResponseType.RUNTIME_ERROR:
{
switch( ErrorType )
{
case Proto.ErrorType.INTERNAL:
con = new ReqlInternalError(Msg);
break;
case Proto.ErrorType.RESOURCE_LIMIT:
con = new ReqlResourceLimitError(Msg);
break;
case Proto.ErrorType.QUERY_LOGIC:
con = new ReqlQueryLogicError(Msg);
break;
case Proto.ErrorType.NON_EXISTENCE:
con = new ReqlNonExistenceError(Msg);
break;
case Proto.ErrorType.OP_FAILED:
con = new ReqlOpFailedError(Msg);
break;
case Proto.ErrorType.OP_INDETERMINATE:
con = new ReqlOpIndeterminateError(Msg);
break;
case Proto.ErrorType.USER:
con = new ReqlUserError(Msg);
break;
case Proto.ErrorType.PERMISSION_ERROR:
con = new ReqlPermissionError(Msg);
break;
default:
con = new ReqlRuntimeError(Msg);
break;
}
break;
}
default:
con = new ReqlError(Msg);
break;
}

public enum ResponseType {
SUCCESS_ATOM = 1,
SUCCESS_SEQUENCE = 2,
SUCCESS_PARTIAL = 3,
WAIT_COMPLETE = 4,
SERVER_INFO = 5,
CLIENT_ERROR = 16,
COMPILE_ERROR = 17,
RUNTIME_ERROR = 18,
}

public enum ErrorType {
INTERNAL = 1000000,
RESOURCE_LIMIT = 2000000,
QUERY_LOGIC = 3000000,
NON_EXISTENCE = 3100000,
OP_FAILED = 4100000,
OP_INDETERMINATE = 4200000,
USER = 5000000,
PERMISSION_ERROR = 6000000,
}

Try turning on protocol debugging, trace both exceptions over the wire, and see if you can detect anything different besides the error msg string in both JSON responses.

If you can detect some other discriminator value (like an error code), re-open the issue and let me know and I'll take a look at adding it. IIRC, it is not possible with the current server protocol implementation.

Hope that helps,
Brian

from rethinkdb.driver.

oliverjanik avatar oliverjanik commented on June 1, 2024

Too bad, I thought that might be the case. Thanks for detailed response.

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.