protected void rethrow(SQLiteException e) { throw new RuntimeException(e.getMessage()); }
protected void rethrow(SQLiteException e) { throw new RuntimeException(e.getMessage()); }
/** * Creates an instance of SQLiteException. * * @param errorCode codes are defined in {@link SQLiteConstants} * @param errorMessage optional error message * @param cause error cause */ public SQLiteException(int errorCode, String errorMessage, Throwable cause) { super("[" + errorCode + "] " + (errorMessage == null ? "sqlite error" : errorMessage), cause); myErrorCode = errorCode; if (Internal.isFineLogging()) { Internal.logFine(getClass(), getMessage()); } }
/** * Converts SQLiteExceptions into the corresponding * EngineException. */ protected static EngineException convertException(SQLiteException e) { if (e instanceof SQLiteInterruptedException) { return new QueryInterruptedException(e.getMessage()); } else { // Normal db errors: syntax error, database not set errors, etc. // This kind of errors should not retry in replicas. if (e.getErrorCode() == SQLiteConstants.SQLITE_ERROR) { String message = e.getMessage(); if (message != null && message.contains("syntax error]")) { return new SyntaxErrorException(e.getMessage()); } else { return new ShouldNotRetryInReplicaException(e.getMessage()); } } if (e.getErrorCode() == SQLite4JavaClient.ERROR_CODE_MAXIMUM_RESULTS_REACHED) { return new TooManyResultsException(e.getMessage()); } else { // Unexpected exception. Should rety in replica. return new ShouldRetryInReplicaException(e.getMessage(), e); } } } }
return e.getMessage(); } finally { if (st != null) st.dispose();