Package io.crate.action.sql

Examples of io.crate.action.sql.SQLActionException


    private static XContentBuilder convert(RestChannel channel, Throwable t) throws IOException {
        XContentBuilder builder = channel.newBuilder().startObject()
            .startObject("error");

        SQLActionException sqlActionException = null;
        builder.field("message", detailedMessage(t));
        if (t instanceof SQLActionException) {
            sqlActionException = (SQLActionException)t;
            builder.field("code", sqlActionException.errorCode());
        } else {
            builder.field("code", 5000);
        }

        builder.endObject();

        if (t != null && channel.request().paramAsBoolean("error_trace", false)
                && sqlActionException != null) {
            builder.field("error_trace", sqlActionException.stackTrace());
        }
        builder.endObject();
        return builder;
    }
View Full Code Here

TOP

Related Classes of io.crate.action.sql.SQLActionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.