Search in sources :

Example 1 with ReadVariableException

use of com.twosigma.beakerx.sql.ReadVariableException in project beakerx by twosigma.

the class SQLCodeRunner method call.

@Override
public TryResult call() throws Exception {
    TryResult either;
    try {
        InternalVariable.setValue(simpleEvaluationObject);
        Object r = sqlEvaluator.executeQuery(simpleEvaluationObject.getExpression(), namespaceClient, sqlEvaluator.defaultConnectionString, sqlEvaluator.namedConnectionString);
        either = TryResult.createResult(r);
    } catch (SQLException e) {
        either = TryResult.createError(e.toString());
    } catch (ThreadDeath e) {
        either = TryResult.createError(INTERUPTED_MSG);
    } catch (ReadVariableException e) {
        either = TryResult.createError(e.getMessage());
    } catch (Throwable e) {
        logger.error(e.getMessage());
        either = TryResult.createError(e.toString());
    }
    return either;
}
Also used : SQLException(java.sql.SQLException) TryResult(com.twosigma.beakerx.TryResult) SimpleEvaluationObject(com.twosigma.beakerx.jvm.object.SimpleEvaluationObject) ReadVariableException(com.twosigma.beakerx.sql.ReadVariableException)

Aggregations

TryResult (com.twosigma.beakerx.TryResult)1 SimpleEvaluationObject (com.twosigma.beakerx.jvm.object.SimpleEvaluationObject)1 ReadVariableException (com.twosigma.beakerx.sql.ReadVariableException)1 SQLException (java.sql.SQLException)1