File: exceptions.py

package info (click to toggle)
pydataverse 0.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,168 kB
  • sloc: python: 4,862; sh: 61; makefile: 13
file content (61 lines) | stat: -rw-r--r-- 1,196 bytes parent folder | download
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""Find out more at https://github.com/GDCC/pyDataverse."""


class DataverseError(Exception):
    """Base exception class for Dataverse-related error."""

    pass


class DataverseApiError(DataverseError):
    """Base exception class for Dataverse-related api error."""

    pass


class OperationFailedError(DataverseApiError):
    """Raised when an operation fails for an unknown reason."""

    pass


class ApiUrlError(DataverseApiError):
    """Raised when the request url is not valid."""

    pass


class ApiResponseError(DataverseApiError):
    """Raised when the requests response fails."""

    pass


class ApiAuthorizationError(OperationFailedError):
    """Raised if a user provides invalid credentials."""

    pass


class DataverseNotEmptyError(OperationFailedError):
    """Raised when a Dataverse has accessioned Datasets."""

    pass


class DataverseNotFoundError(OperationFailedError):
    """Raised when a Dataverse cannot be found."""

    pass


class DatasetNotFoundError(OperationFailedError):
    """Raised when a Dataset cannot be found."""

    pass


class DatafileNotFoundError(OperationFailedError):
    """Raised when a Datafile cannot be found."""

    pass