File: exceptions.rst

package info (click to toggle)
pythondialog 3.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,236 kB
  • ctags: 417
  • sloc: python: 3,625; makefile: 162
file content (98 lines) | stat: -rw-r--r-- 2,731 bytes parent folder | download | duplicates (8)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
.. currentmodule:: dialog

pythondialog-specific exceptions
================================

Class hierarchy
---------------

Here is the hierarchy of notable exceptions raised by this module:

| :exc:`error`
|    :exc:`ExecutableNotFound`
|    :exc:`BadPythonDialogUsage`
|    :exc:`PythonDialogSystemError`
|       :exc:`PythonDialogOSError`
|          :exc:`PythonDialogIOError`  (should not be raised starting from
                                        Python 3.3, as :exc:`IOError` becomes
                                        an alias of :exc:`OSError`)
|       :exc:`PythonDialogErrorBeforeExecInChildProcess`
|       :exc:`PythonDialogReModuleError`
|    :exc:`UnexpectedDialogOutput`
|    :exc:`DialogTerminatedBySignal`
|    :exc:`DialogError`
|    :exc:`UnableToRetrieveBackendVersion`
|    :exc:`UnableToParseBackendVersion`
|       :exc:`UnableToParseDialogBackendVersion`
|    :exc:`InadequateBackendVersion`
|    :exc:`PythonDialogBug`
|    :exc:`ProbablyPythonBug`

As you can see, every exception *exc* among them verifies::

  issubclass(exc, error)

so if you don't need fine-grained error handling, simply catch :exc:`error`
(which will probably be accessible as :exc:`dialog.error` from your program)
and you should be safe.

.. versionchanged:: 2.12
   :exc:`PythonDialogIOError` is now a subclass of :exc:`PythonDialogOSError`
   in order to help with the transition from :exc:`IOError` to :exc:`OSError`
   in the Python language. With this change, you can safely replace ``except
   PythonDialogIOError`` clauses with ``except PythonDialogOSError`` even if
   running under Python < 3.3.


Detailed list
-------------

.. autoexception:: error

.. autoexception:: ExecutableNotFound
   :show-inheritance:

.. autoexception:: BadPythonDialogUsage
   :show-inheritance:

.. autoexception:: PythonDialogSystemError
   :show-inheritance:

.. autoexception:: PythonDialogOSError
   :show-inheritance:

.. autoexception:: PythonDialogIOError
   :show-inheritance:

.. autoexception:: PythonDialogErrorBeforeExecInChildProcess
   :show-inheritance:

.. autoexception:: PythonDialogReModuleError
   :show-inheritance:

.. autoexception:: UnexpectedDialogOutput
   :show-inheritance:

.. autoexception:: DialogTerminatedBySignal
   :show-inheritance:

.. autoexception:: DialogError
   :show-inheritance:

.. autoexception:: UnableToRetrieveBackendVersion
   :show-inheritance:

.. autoexception:: UnableToParseBackendVersion
   :show-inheritance:

.. autoexception:: UnableToParseDialogBackendVersion
   :show-inheritance:

.. autoexception:: InadequateBackendVersion
   :show-inheritance:

.. autoexception:: PythonDialogBug
   :show-inheritance:

.. autoexception:: ProbablyPythonBug
   :show-inheritance: