Tabnine Logo
DataUtils.getErrorCode
Code IndexAdd Tabnine to your IDE (free)

How to use
getErrorCode
method
in
org.h2.mvstore.DataUtils

Best Java code snippets using org.h2.mvstore.DataUtils.getErrorCode (Showing top 19 results out of 315)

origin: com.h2database/h2

/**
 * Convert the illegal state exception to a database exception.
 *
 * @param e the illegal state exception
 * @return the database exception
 */
DbException convertException(IllegalStateException e) {
  if (DataUtils.getErrorCode(e.getMessage()) ==
      DataUtils.ERROR_TRANSACTION_LOCKED) {
    throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1,
        e, getName());
  }
  return store.convertIllegalStateException(e);
}
origin: com.h2database/h2

} catch (IllegalStateException e) {
  if (DataUtils.getErrorCode(e.getMessage()) == DataUtils.ERROR_CHUNK_NOT_FOUND) {
origin: com.h2database/h2

/**
 * Convert the illegal state exception to the correct database
 * exception.
 *
 * @param e the illegal state exception
 * @return the database exception
 */
DbException convertIllegalStateException(IllegalStateException e) {
  int errorCode = DataUtils.getErrorCode(e.getMessage());
  if (errorCode == DataUtils.ERROR_FILE_CORRUPT) {
    if (encrypted) {
      throw DbException.get(
          ErrorCode.FILE_ENCRYPTION_ERROR_1,
          e, fileName);
    }
  } else if (errorCode == DataUtils.ERROR_FILE_LOCKED) {
    throw DbException.get(
        ErrorCode.DATABASE_ALREADY_OPEN_1,
        e, fileName);
  } else if (errorCode == DataUtils.ERROR_READING_FAILED) {
    throw DbException.get(
        ErrorCode.IO_EXCEPTION_1,
        e, fileName);
  }
  throw DbException.get(
      ErrorCode.FILE_CORRUPTED_1,
      e, fileName);
}
origin: com.h2database/h2

} catch (IllegalStateException e) {
  if (DataUtils.getErrorCode(e.getMessage()) ==
      DataUtils.ERROR_CHUNK_NOT_FOUND) {
    cursor = map.cursor(currentKey);
origin: com.h2database/h2

} catch (IllegalStateException e) {
  if (DataUtils.getErrorCode(e.getMessage()) ==
      DataUtils.ERROR_CHUNK_NOT_FOUND) {
    cursor = map.cursor(currentKey);
origin: com.h2database/h2

int errorCode = DataUtils.getErrorCode(e.getMessage());
if (errorCode == DataUtils.ERROR_WRITING_FAILED) {
origin: org.wowtools/h2

/**
 * Convert the illegal state exception to a database exception.
 *
 * @param e the illegal state exception
 * @return the database exception
 */
DbException convertException(IllegalStateException e) {
  if (DataUtils.getErrorCode(e.getMessage()) ==
      DataUtils.ERROR_TRANSACTION_LOCKED) {
    throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1,
        e, getName());
  }
  return store.convertIllegalStateException(e);
}
origin: com.eventsourcing/h2

/**
 * Convert the illegal state exception to a database exception.
 *
 * @param e the illegal state exception
 * @return the database exception
 */
DbException convertException(IllegalStateException e) {
  if (DataUtils.getErrorCode(e.getMessage()) ==
      DataUtils.ERROR_TRANSACTION_LOCKED) {
    throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1,
        e, getName());
  }
  return store.convertIllegalStateException(e);
}
origin: com.h2database/h2-mvstore

} catch (IllegalStateException e) {
  if (DataUtils.getErrorCode(e.getMessage()) == DataUtils.ERROR_CHUNK_NOT_FOUND) {
origin: org.wowtools/h2

} catch (IllegalStateException e) {
  if (DataUtils.getErrorCode(e.getMessage()) == DataUtils.ERROR_CHUNK_NOT_FOUND) {
origin: com.eventsourcing/h2

} catch (IllegalStateException e) {
  if (DataUtils.getErrorCode(e.getMessage()) == DataUtils.ERROR_CHUNK_NOT_FOUND) {
origin: com.eventsourcing/h2

/**
 * Convert the illegal state exception to the correct database
 * exception.
 *
 * @param e the illegal state exception
 * @return the database exception
 */
DbException convertIllegalStateException(IllegalStateException e) {
  int errorCode = DataUtils.getErrorCode(e.getMessage());
  if (errorCode == DataUtils.ERROR_FILE_CORRUPT) {
    if (encrypted) {
      throw DbException.get(
          ErrorCode.FILE_ENCRYPTION_ERROR_1,
          e, fileName);
    }
  } else if (errorCode == DataUtils.ERROR_FILE_LOCKED) {
    throw DbException.get(
        ErrorCode.DATABASE_ALREADY_OPEN_1,
        e, fileName);
  } else if (errorCode == DataUtils.ERROR_READING_FAILED) {
    throw DbException.get(
        ErrorCode.IO_EXCEPTION_1,
        e, fileName);
  }
  throw DbException.get(
      ErrorCode.FILE_CORRUPTED_1,
      e, fileName);
}
origin: org.wowtools/h2

/**
 * Convert the illegal state exception to the correct database
 * exception.
 *
 * @param e the illegal state exception
 * @return the database exception
 */
DbException convertIllegalStateException(IllegalStateException e) {
  int errorCode = DataUtils.getErrorCode(e.getMessage());
  if (errorCode == DataUtils.ERROR_FILE_CORRUPT) {
    if (encrypted) {
      throw DbException.get(
          ErrorCode.FILE_ENCRYPTION_ERROR_1,
          e, fileName);
    }
  } else if (errorCode == DataUtils.ERROR_FILE_LOCKED) {
    throw DbException.get(
        ErrorCode.DATABASE_ALREADY_OPEN_1,
        e, fileName);
  } else if (errorCode == DataUtils.ERROR_READING_FAILED) {
    throw DbException.get(
        ErrorCode.IO_EXCEPTION_1,
        e, fileName);
  }
  throw DbException.get(
      ErrorCode.FILE_CORRUPTED_1,
      e, fileName);
}
origin: com.eventsourcing/h2

} catch (IllegalStateException e) {
  if (DataUtils.getErrorCode(e.getMessage()) ==
      DataUtils.ERROR_CHUNK_NOT_FOUND) {
    cursor = map.cursor(currentKey);
origin: org.wowtools/h2

} catch (IllegalStateException e) {
  if (DataUtils.getErrorCode(e.getMessage()) ==
      DataUtils.ERROR_CHUNK_NOT_FOUND) {
    cursor = map.cursor(currentKey);
origin: com.eventsourcing/h2

} catch (IllegalStateException e) {
  if (DataUtils.getErrorCode(e.getMessage()) ==
      DataUtils.ERROR_CHUNK_NOT_FOUND) {
    cursor = map.cursor(currentKey);
origin: org.wowtools/h2

} catch (IllegalStateException e) {
  if (DataUtils.getErrorCode(e.getMessage()) ==
      DataUtils.ERROR_CHUNK_NOT_FOUND) {
    cursor = map.cursor(currentKey);
origin: com.eventsourcing/h2

int errorCode = DataUtils.getErrorCode(e.getMessage());
if (errorCode == DataUtils.ERROR_WRITING_FAILED) {
origin: org.wowtools/h2

int errorCode = DataUtils.getErrorCode(e.getMessage());
if (errorCode == DataUtils.ERROR_WRITING_FAILED) {
org.h2.mvstoreDataUtilsgetErrorCode

Javadoc

Get the error code from an exception message.

Popular methods of DataUtils

  • readVarInt
    Read a variable size int.
  • appendMap
    Append a map to the string builder, sorted by key.
  • checkArgument
    Throw an IllegalArgumentException if the argument is invalid.
  • copyExcept
    Copy the elements of an array, and remove one element.
  • copyWithGap
    Copy the elements of an array, with a gap.
  • encodeLength
    Convert the length to a length code 0..31. 31 means more than 1 MB.
  • formatMessage
    Format an error message.
  • getCheckValue
    Calculate a check value for the given integer. A check value is mean to verify the data is consisten
  • getFletcher32
    Calculate the Fletcher32 checksum.
  • getPageChunkId
    Get the chunk id from the position.
  • getPageMaxLength
    Get the maximum length for the given code. For the code 31, PAGE_LARGE is returned.
  • getPageOffset
    Get the offset from the position.
  • getPageMaxLength,
  • getPageOffset,
  • getPagePos,
  • getPageType,
  • getVarIntLen,
  • initCause,
  • newIllegalArgumentException,
  • newIllegalStateException,
  • newUnsupportedOperationException

Popular in Java

  • Reading from database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now