/
errors.py
45 lines (30 loc) · 1.22 KB
/
errors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
pgxnclient -- package exceptions
These exceptions can be used to signal expected problems and to exit in a
controlled way from the program.
"""
# Copyright (C) 2011 Daniele Varrazzo
# This file is part of the PGXN client
class PgxnException(Exception):
"""Base class for the exceptions known in the pgxn package."""
class PgxnClientException(PgxnException):
"""Base class for the exceptions raised by the pgxnclient package."""
class UserAbort(PgxnClientException):
"""The user requested to stop the operation."""
class BadSpecError(PgxnClientException):
"""A bad package specification."""
class ProcessError(PgxnClientException):
"""An error raised calling an external program."""
class NotFound(PgxnException):
"""Something requested by the user not found on PGXN"""
class NetworkError(PgxnClientException):
"""An error from the other side of the wire."""
class BadChecksum(PgxnClientException):
"""A downloaded file is not what expected."""
class ResourceNotFound(NetworkError):
"""Resource not found on the server."""
class BadRequestError(Exception):
"""Bad request from our side.
This exception is a basic one because it should be rased upon an error
on our side.
"""