| 1 |
# |
| 2 |
# Licensed to the Apache Software Foundation (ASF) under one |
| 3 |
# or more contributor license agreements. See the NOTICE file |
| 4 |
# distributed with this work for additional information |
| 5 |
# regarding copyright ownership. The ASF licenses this file |
| 6 |
# to you under the Apache License, Version 2.0 (the |
| 7 |
# "License"); you may not use this file except in compliance |
| 8 |
# with the License. You may obtain a copy of the License at |
| 9 |
# |
| 10 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 |
# |
| 12 |
# Unless required by applicable law or agreed to in writing, |
| 13 |
# software distributed under the License is distributed on an |
| 14 |
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 |
# KIND, either express or implied. See the License for the |
| 16 |
# specific language governing permissions and limitations |
| 17 |
# under the License. |
| 18 |
# |
| 19 |
|
| 20 |
from __future__ import absolute_import |
| 21 |
|
| 22 |
from cproton import PN_TIMEOUT, PN_INTR |
| 23 |
|
| 24 |
|
| 25 |
class ProtonException(Exception): |
| 26 |
""" |
| 27 |
The root of the proton exception hierarchy. All proton exception |
| 28 |
classes derive from this exception. |
| 29 |
""" |
| 30 |
pass |
| 31 |
|
| 32 |
|
| 33 |
class Timeout(ProtonException): |
| 34 |
""" |
| 35 |
A timeout exception indicates that a blocking operation has timed |
| 36 |
out. |
| 37 |
""" |
| 38 |
pass |
| 39 |
|
| 40 |
|
| 41 |
class Interrupt(ProtonException): |
| 42 |
""" |
| 43 |
An interrupt exception indicates that a blocking operation was interrupted. |
| 44 |
""" |
| 45 |
pass |
| 46 |
|
| 47 |
|
| 48 |
EXCEPTIONS = { |
| 49 |
PN_TIMEOUT: Timeout, |
| 50 |
PN_INTR: Interrupt |
| 51 |
} |
| 52 |
|
| 53 |
|
| 54 |
class MessageException(ProtonException): |
| 55 |
""" |
| 56 |
The MessageException class is the root of the message exception |
| 57 |
hierarchy. All exceptions generated by the Message class derive from |
| 58 |
this exception. |
| 59 |
""" |
| 60 |
pass |
| 61 |
|
| 62 |
|
| 63 |
class DataException(ProtonException): |
| 64 |
""" |
| 65 |
The DataException class is the root of the Data exception hierarchy. |
| 66 |
All exceptions raised by the Data class extend this exception. |
| 67 |
""" |
| 68 |
pass |
| 69 |
|
| 70 |
|
| 71 |
class TransportException(ProtonException): |
| 72 |
""" |
| 73 |
An exception class raised when exceptions or errors related to the AMQP |
| 74 |
transport arise. |
| 75 |
""" |
| 76 |
pass |
| 77 |
|
| 78 |
|
| 79 |
class SSLException(TransportException): |
| 80 |
""" |
| 81 |
An exception class raised when exceptions or errors related to SSL usage |
| 82 |
arise. These typically include problems with initializing or configuring |
| 83 |
SSL. |
| 84 |
""" |
| 85 |
pass |
| 86 |
|
| 87 |
|
| 88 |
class SSLUnavailable(SSLException): |
| 89 |
""" |
| 90 |
An exception class raised when exceptions or errors related to SSL |
| 91 |
availability arise. These typically include problems finding the SSL |
| 92 |
libraries. |
| 93 |
""" |
| 94 |
pass |
| 95 |
|
| 96 |
|
| 97 |
class ConnectionException(ProtonException): |
| 98 |
""" |
| 99 |
An exception class raised when exceptions or errors related to a |
| 100 |
connection arise. |
| 101 |
""" |
| 102 |
pass |
| 103 |
|
| 104 |
|
| 105 |
class SessionException(ProtonException): |
| 106 |
""" |
| 107 |
An exception class raised when exceptions or errors related to a |
| 108 |
session arise. |
| 109 |
""" |
| 110 |
pass |
| 111 |
|
| 112 |
|
| 113 |
class LinkException(ProtonException): |
| 114 |
""" |
| 115 |
An exception class raised when exceptions or errors related to a |
| 116 |
link arise. |
| 117 |
""" |
| 118 |
pass |