Class ScriptStatementFailedException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.dao.DataAccessException
org.springframework.data.cassandra.core.cql.session.init.ScriptException
org.springframework.data.cassandra.core.cql.session.init.ScriptStatementFailedException
All Implemented Interfaces:
Serializable

public class ScriptStatementFailedException extends ScriptException
Thrown by ScriptUtils if a statement in an CQL script failed when executing it against the target database.
Since:
3.0
Author:
Mark Paluch
See Also:
  • Constructor Details

    • ScriptStatementFailedException

      public ScriptStatementFailedException(String stmt, int stmtNumber, org.springframework.core.io.support.EncodedResource encodedResource, Throwable cause)
      Parameters:
      stmt - the actual CQL statement that failed.
      stmtNumber - the statement number in the CQL script (i.e., the nth statement present in the resource).
      encodedResource - the resource from which the CQL statement was read.
      cause - the root cause.
  • Method Details

    • buildErrorMessage

      public static String buildErrorMessage(String stmt, int stmtNumber, org.springframework.core.io.support.EncodedResource encodedResource)
      Build an error message for an CQL script execution failure, based on the supplied arguments.
      Parameters:
      stmt - the actual CQL statement that failed.
      stmtNumber - the statement number in the CQL script (i.e., the nth statement present in the resource).
      encodedResource - the resource from which the CQL statement was read
      Returns:
      an error message suitable for an exception's detail message or logging.