Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/exc.py
# Copyright (C) 2015 The Software Heritage developers | # Copyright (C) 2015 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
class Error(Exception): | |||||
def __str__(self): | |||||
return 'storage error on object: %s' % self.args | |||||
class ObjNotFoundError(Error): | |||||
def __str__(self): | |||||
return 'object not found: %s' % self.args | |||||
class StorageDBError(Exception): | class StorageDBError(Exception): | ||||
"""Specific storage db error (connection, erroneous queries, etc...) | """Specific storage db error (connection, erroneous queries, etc...) | ||||
""" | """ | ||||
def __str__(self): | def __str__(self): | ||||
return 'An unexpected error occurred in the backend: %s' % self.args | return 'An unexpected error occurred in the backend: %s' % self.args | ||||
Show All 9 Lines |