Skip to content

Commit ace8001

Browse files
committed
docs: reorder errors' sequence in "Exceptions"
PR Closed: #1080
1 parent c257166 commit ace8001

File tree

1 file changed

+65
-57
lines changed

1 file changed

+65
-57
lines changed

docs/source/reference/exception.rst

Lines changed: 65 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,68 @@
44

55
TensorBay SDK defines a series of custom exceptions.
66

7-
.. glossary::
7+
*********************
8+
Exception Hierarchy
9+
*********************
810

9-
TensorBayException
10-
:class:`~tensorbay.exception.TensorBayException` is the base class for TensorBay SDK custom exceptions.
11+
The class hierarchy for TensorBay custom exceptions is::
1112

12-
TBRNError
13-
:class:`~tensorbay.exception.TBRNError` defines the exception for invalid TBRN. Raised when the TBRN format is incorrect.
13+
+-- TensorBayException
14+
+-- ClientError
15+
+-- StatusError
16+
+-- DatasetTypeError
17+
+-- FrameError
18+
+-- ResponseError
19+
+-- AccessDeniedError
20+
+-- ForbiddenError
21+
+-- InvalidParamsError
22+
+-- NameConflictError
23+
+-- RequestParamsMissingError
24+
+-- ResourceNotExistError
25+
+-- InternalServerError
26+
+-- UnauthorizedError
27+
+-- TBRNError
28+
+-- OpenDatasetError
29+
+-- NoFileError
30+
+-- FileStructureError
1431

15-
ClientError
16-
:class:`~tensorbay.exception.ClientError` is the base class for custom exceptions in the client module.
1732

18-
StatusError
19-
:class:`~tensorbay.exception.StatusError` defines the exception for illegal status in the client module.
20-
Raised when the status is draft or commit, while the required status is commit or draft.
2133

22-
DatasetTypeError
23-
:class:`~tensorbay.exception.DatasetTypeError` defines the exception for incorrect type of the requested dataset in the client module.
24-
Raised when the type of the required dataset is inconsistent with the input "is_fusion" parameter while getting dataset from TensorBay.
2534

26-
FrameError
27-
:class:`~tensorbay.exception.FrameError` defines the exception for incorrect frame id in the client module.
28-
Raised when the frame id and timestamp of a frame conflicts or missing.
35+
***********************
36+
Exception Definitions
37+
***********************
2938

30-
ResponseError
31-
:class:`~tensorbay.exception.ResponseError` defines the exception for post response error in the client module.
32-
Raised when the response from TensorBay has error. And different subclass exceptions will be raised according to different error code.
39+
The definitions for TensorBay custom exceptions are:
40+
41+
.. glossary::
3342

3443
AccessDeniedError
3544
:class:`~tensorbay.exception.AccessDeniedError` defines the exception for access denied response error in the client module.
3645
Raised when the current account has no permission to access the resource.
3746

47+
ClientError
48+
:class:`~tensorbay.exception.ClientError` is the base class for custom exceptions in the client module.
49+
50+
DatasetTypeError
51+
:class:`~tensorbay.exception.DatasetTypeError` defines the exception for incorrect type of the requested dataset in the client module.
52+
Raised when the type of the required dataset is inconsistent with the input "is_fusion" parameter while getting dataset from TensorBay.
53+
54+
FileStructureError
55+
:class:`~tensorbay.exception.FileStructureError` defines the exception for incorrect file structure in the opendataset directory.
56+
3857
ForbiddenError
3958
:class:`~tensorbay.exception.ForbiddenError` defines the exception for illegal operations Tensorbay forbids.
4059
Raised when the current operation is forbidden by Tensorbay.
4160

61+
FrameError
62+
:class:`~tensorbay.exception.FrameError` defines the exception for incorrect frame id in the client module.
63+
Raised when the frame id and timestamp of a frame conflicts or missing.
64+
65+
InternalServerError
66+
:class:`~tensorbay.exception.InternalServerError` defines the exception for internal server error in the client module.
67+
Raised when internal server error was responded.
68+
4269
InvalidParamsError
4370
:class:`~tensorbay.exception.InvalidParamsError` defines the exception for invalid parameters response error in the client module.
4471
Raised when the parameters of the request are invalid.
@@ -47,6 +74,12 @@ TensorBay SDK defines a series of custom exceptions.
4774
:class:`~tensorbay.exception.NameConflictError` defines the exception for name conflict response error in the client module.
4875
Raised when the name of the resource to be created already exists on Tensorbay.
4976

77+
NoFileError
78+
:class:`~tensorbay.exception.NoFileError` defines the exception for no matching file found in the opendataset directory.
79+
80+
OpenDatasetError
81+
:class:`~tensorbay.exception.OpenDatasetError` is the base class for custom exceptions in the opendataset module.
82+
5083
RequestParamsMissingError
5184
:class:`~tensorbay.exception.RequestParamsMissingError` defines the exception for request parameters missing response error in the client module.
5285
Raised when necessary parameters of the request are missing.
@@ -55,45 +88,20 @@ TensorBay SDK defines a series of custom exceptions.
5588
:class:`~tensorbay.exception.ResourceNotExistError` defines the exception for resource not existing response error in the client module.
5689
Raised when the request resource does not exist on Tensorbay.
5790

58-
InternalServerError
59-
:class:`~tensorbay.exception.InternalServerError` defines the exception for internal server error in the client module.
60-
Raised when internal server error was responded.
61-
62-
UnauthorizedError
63-
:class:`~tensorbay.exception.UnauthorizedError` defines the exception for unauthorized response error in the client module.
64-
Raised when the :ref:`reference/glossary:accesskey` is incorrect.
65-
66-
OpenDatasetError
67-
:class:`~tensorbay.exception.OpenDatasetError` is the base class for custom exceptions in the opendataset module.
68-
69-
NoFileError
70-
:class:`~tensorbay.exception.NoFileError` defines the exception for no matching file found in the opendataset directory.
71-
72-
FileStructureError
73-
:class:`~tensorbay.exception.FileStructureError` defines the exception for incorrect file structure in the opendataset directory.
91+
ResponseError
92+
:class:`~tensorbay.exception.ResponseError` defines the exception for post response error in the client module.
93+
Raised when the response from TensorBay has error. And different subclass exceptions will be raised according to different error code.
7494

75-
*********************
76-
Exception hierarchy
77-
*********************
95+
StatusError
96+
:class:`~tensorbay.exception.StatusError` defines the exception for illegal status in the client module.
97+
Raised when the status is draft or commit, while the required status is commit or draft.
7898

79-
The class hierarchy for TensorBay custom exceptions is::
99+
TBRNError
100+
:class:`~tensorbay.exception.TBRNError` defines the exception for invalid TBRN. Raised when the TBRN format is incorrect.
80101

81-
+-- TensorBayException
82-
+-- ClientError
83-
+-- StatusError
84-
+-- DatasetTypeError
85-
+-- FrameError
86-
+-- ResponseError
87-
+-- AccessDeniedError
88-
+-- ForbiddenError
89-
+-- InvalidParamsError
90-
+-- NameConflictError
91-
+-- RequestParamsMissingError
92-
+-- ResourceNotExistError
93-
+-- InternalServerError
94-
+-- UnauthorizedError
95-
+-- TBRNError
96-
+-- OpenDatasetError
97-
+-- NoFileError
98-
+-- FileStructureError
102+
TensorBayException
103+
:class:`~tensorbay.exception.TensorBayException` is the base class for TensorBay SDK custom exceptions.
99104

105+
UnauthorizedError
106+
:class:`~tensorbay.exception.UnauthorizedError` defines the exception for unauthorized response error in the client module.
107+
Raised when the :ref:`reference/glossary:accesskey` is incorrect.

0 commit comments

Comments
 (0)