|
1 | 1 | # This file is part of ssh2-python. |
2 | | -# Copyright (C) 2017 Panos Kittenis |
| 2 | +# Copyright (C) 2017-2018 Panos Kittenis |
3 | 3 |
|
4 | 4 | # This library is free software; you can redistribute it and/or |
5 | 5 | # modify it under the terms of the GNU Lesser General Public |
|
16 | 16 |
|
17 | 17 |
|
18 | 18 | class AgentError(Exception): |
19 | | - pass |
| 19 | + """Base class for all SSH Agent errors""" |
20 | 20 |
|
21 | 21 |
|
22 | 22 | class AuthenticationError(Exception): |
23 | | - pass |
| 23 | + """Base class for all authentication errors""" |
24 | 24 |
|
25 | 25 |
|
26 | 26 | class AgentConnectionError(AgentError): |
27 | | - pass |
| 27 | + """Raised on SSH Agent connection errors""" |
28 | 28 |
|
29 | 29 |
|
30 | 30 | class AgentAuthenticationError(AuthenticationError): |
31 | | - pass |
| 31 | + """Raised on SSH Agent authentication errors""" |
32 | 32 |
|
33 | 33 |
|
34 | 34 | class AgentListIdentitiesError(AgentError): |
35 | | - pass |
| 35 | + """Raised on SSH Agent list identities errors""" |
36 | 36 |
|
37 | 37 |
|
38 | 38 | class AgentGetIdentityError(AgentError): |
39 | | - pass |
| 39 | + """Raised on SSH Agent get identity errors""" |
40 | 40 |
|
41 | 41 |
|
42 | | -class SessionStartupError(Exception): |
43 | | - pass |
| 42 | +class AgentProtocolError(Exception): |
| 43 | + """Raised on SSH agent protocol errors""" |
44 | 44 |
|
45 | 45 |
|
46 | | -class SessionHandshakeError(Exception): |
47 | | - pass |
| 46 | +class SessionError(Exception): |
| 47 | + """Base class for all session errors""" |
48 | 48 |
|
49 | 49 |
|
50 | | -class SessionHostKeyError(Exception): |
| 50 | +class SessionStartupError(SessionError): |
| 51 | + """Raised on session startup errors""" |
| 52 | + |
| 53 | + |
| 54 | +class SessionHandshakeError(SessionError): |
| 55 | + """Raised on session handshake errors""" |
| 56 | + |
| 57 | + |
| 58 | +class SessionHostKeyError(SessionError): |
51 | 59 | """Raised on errors getting server host key""" |
52 | 60 |
|
53 | 61 |
|
54 | | -class SCPError(Exception): |
55 | | - """Raised on SCP errors""" |
| 62 | +class BannerRecvError(SessionError): |
| 63 | + """Raised on errors receiving banner""" |
| 64 | + |
| 65 | + |
| 66 | +class BannerSendError(SessionError): |
| 67 | + """Raised on errors sending banner""" |
| 68 | + |
| 69 | + |
| 70 | +class KeyExchangeError(SessionError): |
| 71 | + """Raised on errors exchanging keys""" |
| 72 | + |
| 73 | + |
| 74 | +class Timeout(SessionError): |
| 75 | + """Raised on timeouts""" |
| 76 | + |
| 77 | + |
| 78 | +class HostkeyInitError(SessionError): |
| 79 | + """Raised on errors initialiasing host key""" |
| 80 | + |
| 81 | + |
| 82 | +class HostkeySignError(SessionError): |
| 83 | + """Raised on errors signing host key""" |
| 84 | + |
| 85 | + |
| 86 | +class DecryptError(SessionError): |
| 87 | + """Raised on decryption errors""" |
| 88 | + |
| 89 | + |
| 90 | +class SocketDisconnectError(Exception): |
| 91 | + """Raised on socket disconnection errors""" |
| 92 | + |
| 93 | + |
| 94 | +class ProtocolError(Exception): |
| 95 | + """Raised on protocol errors""" |
| 96 | + |
| 97 | + |
| 98 | +class PasswordExpiredError(AuthenticationError): |
| 99 | + """Raised on password expired errors""" |
| 100 | + |
| 101 | + |
| 102 | +class FileError(Exception): |
| 103 | + """Raised on file errors""" |
| 104 | + |
| 105 | + |
| 106 | +class MethodNoneError(Exception): |
| 107 | + """Raised on invalid method errors""" |
| 108 | + |
| 109 | + |
| 110 | +class PublicKeyError(Exception): |
| 111 | + """Base class for all public key protocol errors""" |
| 112 | + |
| 113 | + |
| 114 | +class PublicKeyInitError(PublicKeyError): |
| 115 | + """Raised on errors initialising public key system""" |
| 116 | + |
| 117 | + |
| 118 | +class PublickeyUnrecognizedError(SessionError): |
| 119 | + """Raised on unrecognised public key errors""" |
| 120 | + |
| 121 | + |
| 122 | +class PublickeyUnverifiedError(SessionError): |
| 123 | + """Raised on public key verification errors""" |
56 | 124 |
|
57 | 125 |
|
58 | 126 | class ChannelError(Exception): |
59 | | - pass |
| 127 | + """Base class for all channel errors""" |
| 128 | + |
| 129 | + |
| 130 | +class ChannelOutOfOrderError(ChannelError): |
| 131 | + """Raised on channel commands out of order errors""" |
| 132 | + |
| 133 | + |
| 134 | +class ChannelFailure(ChannelError): |
| 135 | + """Raised on channel failures""" |
| 136 | + |
| 137 | + |
| 138 | +class ChannelRequestDenied(ChannelError): |
| 139 | + """Raised on channel request denied errors""" |
| 140 | + |
| 141 | + |
| 142 | +class ChannelUnknownError(ChannelError): |
| 143 | + """Raised on unknown channel errors""" |
| 144 | + |
| 145 | + |
| 146 | +class ChannelWindowExceeded(ChannelError): |
| 147 | + """Raised on channel window exceeded errors""" |
| 148 | + |
| 149 | + |
| 150 | +class ChannelPacketExceeded(ChannelError): |
| 151 | + """Raised on channel max packet length exceeded errors""" |
| 152 | + |
| 153 | + |
| 154 | +class ChannelClosedError(ChannelError): |
| 155 | + """Raised on channel closed errors""" |
| 156 | + |
| 157 | + |
| 158 | +class ChannelEOFSentError(ChannelError): |
| 159 | + """Raised on channel EOF errors""" |
| 160 | + |
| 161 | + |
| 162 | +class SCPError(Exception): |
| 163 | + """Raised on SCP errors. Base class for all SCP exceptions.""" |
| 164 | + |
| 165 | + |
| 166 | +class SCPProtocolError(SCPError): |
| 167 | + """Raised on SCP protocol errors""" |
| 168 | + |
| 169 | + |
| 170 | +class ZlibError(SessionError): |
| 171 | + """Raised on zlib errors""" |
| 172 | + |
| 173 | + |
| 174 | +class SocketTimeout(SessionError): |
| 175 | + """Raised on socket timeouts""" |
| 176 | + |
| 177 | + |
| 178 | +class RequestDeniedError(SessionError): |
| 179 | + """Raised on request denied errors""" |
| 180 | + |
| 181 | + |
| 182 | +class MethodNotSupported(SessionError): |
| 183 | + """Raised on authentication method not supported errors""" |
| 184 | + |
| 185 | + |
| 186 | +class InvalidError(Exception): |
| 187 | + """Raised on invalid request errors""" |
| 188 | + |
| 189 | + |
| 190 | +class InvalidPollTypeError(Exception): |
| 191 | + """Raised on invalid poll type errors""" |
| 192 | + |
| 193 | + |
| 194 | +class PublicKeyProtocolError(Exception): |
| 195 | + """Raised on public key protocol errors""" |
| 196 | + |
| 197 | + |
| 198 | +class BufferTooSmallError(Exception): |
| 199 | + """Raised on buffer too small errors""" |
| 200 | + |
| 201 | + |
| 202 | +class BadUseError(Exception): |
| 203 | + """Raised on API bad use errors""" |
| 204 | + |
| 205 | + |
| 206 | +class CompressError(SessionError): |
| 207 | + """Raised on compression errors""" |
| 208 | + |
| 209 | + |
| 210 | +class OutOfBoundaryError(Exception): |
| 211 | + """Raised on out of boundary errors""" |
| 212 | + |
| 213 | + |
| 214 | +class SocketRecvError(Exception): |
| 215 | + """Raised on socket receive errors""" |
| 216 | + |
| 217 | + |
| 218 | +class EncryptError(SessionError): |
| 219 | + """Raised on encryption errors""" |
| 220 | + |
| 221 | + |
| 222 | +class BadSocketError(Exception): |
| 223 | + """Raised on use of bad socket errors""" |
| 224 | + |
| 225 | + |
| 226 | +class SFTPError(Exception): |
| 227 | + """Base class for SFTP errors""" |
| 228 | + |
| 229 | + |
| 230 | +class SFTPProtocolError(SFTPError): |
| 231 | + """Raised on SFTP protocol errors""" |
60 | 232 |
|
61 | 233 |
|
62 | | -class SFTPHandleError(Exception): |
63 | | - pass |
| 234 | +class SFTPHandleError(SFTPError): |
| 235 | + """Raised on SFTP handle errors""" |
64 | 236 |
|
65 | 237 |
|
66 | | -class SFTPBufferTooSmall(Exception): |
67 | | - pass |
| 238 | +class SFTPBufferTooSmall(SFTPError): |
| 239 | + """Raised on SFTP buffer too small errors""" |
68 | 240 |
|
69 | 241 |
|
70 | | -class SFTPIOError(Exception): |
71 | | - pass |
| 242 | +class SFTPIOError(SFTPError): |
| 243 | + """Raised on SFTP I/O errors""" |
72 | 244 |
|
73 | 245 |
|
74 | 246 | class KnownHostError(Exception): |
|
0 commit comments