# Possible exceptions

All secretstorage functions may raise various exceptions when something goes wrong. All exceptions derive from base `SecretStorageException` class.

exception secretstorage.exceptions.ItemNotFoundException

  Raised when an item does not exist or has been deleted. Example of handling:

      >>> import secretstorage
      >>> connection = secretstorage.dbus_init()
      >>> item_path = '/not/existing/path'
      >>> try:
      ...     item = secretstorage.Item(connection, item_path)
      ... except secretstorage.ItemNotFoundException:
      ...     print('Item not found!')
      ...
      Item not found!

exception secretstorage.exceptions.LockedException

  Raised when an action cannot be performed because the collection is locked. Use `is_locked()` to check if the collection is locked, and `unlock()` to unlock it.

exception secretstorage.exceptions.PromptDismissedException

  Raised when a prompt was dismissed by the user.

  New in version 3.1.

exception secretstorage.exceptions.SecretServiceNotAvailableException

  Raised by `Item` or `Collection` constructors, or by other functions in the `secretstorage.collection` module, when the Secret Service API is not available.

exception secretstorage.exceptions.SecretStorageException

  All exceptions derive from this class.