Class StorageException

All Implemented Interfaces:

public final class StorageException extends Exception
This class describes an exception that could be produced by the secure preferences. Depending on the error code, callers might be able to mitigate the originating problems and re-try the operation (for instance, if incorrect password was provided or in case a required storage module was not available).

This class is not intended to be instantiated or extended by clients.

See Also:
  • Field Details


      public static final int INTERNAL_ERROR
      Internal error due to a problem in setup or internal implementation.
      See Also:

      public static final int NO_SECURE_MODULE
      No appropriate password provider module is available.
      See Also:

      public static final int ENCRYPTION_ERROR
      Error occurred during the encryption process.

      Such error might have being created by using inappropriate key, for instance, using key that is too strong for the cryptographic policy in JVM.

      See Also:

      public static final int DECRYPTION_ERROR
      Error occurred during the decryption process.

      This error might be caused by an incorrect password or corrupted data.

      See Also:

      public static final int NO_PASSWORD
      Secure preferences were unable to retrieve the password.
      See Also:
  • Constructor Details

    • StorageException

      public StorageException(int errorCode, Throwable exception)
    • StorageException

      public StorageException(int errorCode, String message)
  • Method Details

    • getErrorCode

      public int getErrorCode()