mysql.exceptions.client

Package mysql :: Package exceptions :: Module client |
[hide private]
[frames] | no frames]

# Source Code for Module mysql.exceptions.client

      1  # $Header: /home/cvs2/mysql/mysql/exceptions/client.py,v 1.3 2006/08/26 20:19:52 ehuss Exp $
      2  # Copyright (c) 2006, Eric Huss
      3  # All rights reserved.
      4  #
      5  # Redistribution and use in source and binary forms, with or without
      6  # modification, are permitted provided that the following conditions are met:
      7  #
      8  # 1. Redistributions of source code must retain the above copyright notice,
      9  #    this list of conditions and the following disclaimer.
     10  # 2. Redistributions in binary form must reproduce the above copyright notice,
     11  #    this list of conditions and the following disclaimer in the documentation
     12  #    and/or other materials provided with the distribution.
     13  # 3. Neither the name of Eric Huss nor the names of any contributors may be
     14  #    used to endorse or promote products derived from this software without
     15  #    specific prior written permission.
     16  #
     17  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     18  # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     19  # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     20  # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     21  # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     22  # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     23  # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     24  # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     25  # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     26  # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     27  # POSSIBILITY OF SUCH DAMAGE.
     28
     29  """Exceptions from the MySQL client API.
     30
     31  These are all errors that the client-side of the MySQL API may generate.
     32  """
     33
     34  __version__ = '$Revision: 1.3 $'
     35
     36  from mysql.exceptions.base import MySQL_Error
     37
     38
     39 -class Unknown_Error(MySQL_Error):
     40
     41      """An unknown error occurred."""
     42
     43 -class Socket_Create_Error(MySQL_Error):
     44
     45      """Failed to create a Unix socket."""
     46
     47 -class Connection_Error(MySQL_Error):
     48
     49      """Failed to connect to the local MySQL server."""
     50
     51 -class Conn_Host_Error(MySQL_Error):
     52
     53      """Failed to connect to the MySQL server."""
     54
     55 -class IP_Sock_Error(MySQL_Error):
     56
     57      """Failed to create an IP socket."""
     58
     59 -class Unknown_Host(MySQL_Error):
     60
     61      """Failed to find the IP address for the hostname."""
     62
     63 -class Server_Gone_Error(MySQL_Error):
     64
     65      """MySQL server has gone away."""
     66
     67 -class Version_Error(MySQL_Error):
     68
     69      """A protocol mismatch resulted from attempting to connect to a server with
     70      a client library that uses a different protocol version. This can happen if
     71      you use a very old client library to connect to a new server that wasn't
     72      started with the --old-protocol option.
     73      """
     74
     75 -class Out_Of_Memory(MySQL_Error):
     76
     77      """MySQL client ran out of memory."""
     78
     79 -class Wrong_Host_Info(MySQL_Error):
     80
     81      """Wrong host info."""
     82
     83 -class Localhost_Connection(MySQL_Error):
     84
     85      """Localhost via UNIX socket."""
     86
     87 -class TCP_Connection(MySQL_Error):
     88
     89      """TCP connection error."""
     90
     91 -class Server_Handshake_Err(MySQL_Error):
     92
     93      """Error in server handshake."""
     94
     95 -class Server_Lost(MySQL_Error):
     96
     97      """If connect_timeout > 0 and it took longer than connect_timeout seconds
     98      to connect to the server or if the server died while executing the
     99      init-command.
    100      """
    101
    102 -class Commands_Out_Of_Sync(MySQL_Error):
    103
    104      """Commands out of sync; you can't run this command now."""
    105
    106 -class Named_Pipe_Connection(MySQL_Error):
    107
    108      """Failed to connect to a named pipe on Windows."""
    109
    110 -class Named_Pipe_Wait_Error(MySQL_Error):
    111
    112      """Failed to wait for a named pipe on Windows."""
    113
    114 -class Named_Pipe_Open_Error(MySQL_Error):
    115
    116      """Failed to create a named pipe on Windows."""
    117
    118 -class Named_Pipe_Set_State_Error(MySQL_Error):
    119
    120      """Failed to get a pipe handler on Windows."""
    121
    122 -class Cant_Read_Charset(MySQL_Error):
    123
    124      """Unable to read the character set file."""
    125
    126 -class Net_Packet_Too_Large(MySQL_Error):
    127
    128      """Got packet bigger than 'max_allowed_packet' bytes."""
    129
    130 -class Embedded_Connection(MySQL_Error):
    131
    132      """Embedded server."""
    133
    134 -class Probe_Slave_Status(MySQL_Error):
    135
    136      """Error on SHOW SLAVE STATUS:."""
    137
    138 -class Probe_Slave_Hosts(MySQL_Error):
    139
    140      """Error on SHOW SLAVE HOSTS:."""
    141
    142 -class Probe_Slave_Connect(MySQL_Error):
    143
    144      """Error connecting to slave:."""
    145
    146 -class Probe_Master_Connect(MySQL_Error):
    147
    148      """Error connecting to master:."""
    149
    150 -class Ssl_Connection_Error(MySQL_Error):
    151
    152      """SSL connection error."""
    153
    154 -class Malformed_Packet(MySQL_Error):
    155
    156      """Malformed packet."""
    157
    158 -class Wrong_License(MySQL_Error):
    159
    160      """Invalid license when connecting to server."""
    161
    162 -class Null_Pointer(MySQL_Error):
    163
    164      """Invalid use of null pointer."""
    165
    166 -class No_Prepare_Stmt(MySQL_Error):
    167
    168      """Statement not prepared."""
    169
    170 -class Params_Not_Bound(MySQL_Error):
    171
    172      """No data supplied for parameters in prepared statement."""
    173
    174 -class Data_Truncated(MySQL_Error):
    175
    176      """Data truncated."""
    177
    178 -class No_Parameters_Exists(MySQL_Error):
    179
    180      """No parameters exist in the statement."""
    181
    182 -class Invalid_Parameter_Number(MySQL_Error):
    183
    184      """Invalid parameter number."""
    185
    186 -class Invalid_Buffer_Use(MySQL_Error):
    187
    188      """Indicates if the bind is to supply the long data in chunks and if the
    189      buffer type is non string or binary.
    190      """
    191
    192 -class Unsupported_Param_Type(MySQL_Error):
    193
    194      """The conversion is not supported. Possibly the buffer_type value is
    195      illegal or is not one of the supported types.
    196      """
    197
    198 -class Shared_Memory_Connection(MySQL_Error):
    199
    200      """Connection failure when using shared memory."""
    201
    202 -class Shared_Memory_Connect_Request_Error(MySQL_Error):
    203
    204      """Can't open shared memory; client could not create request event."""
    205
    206 -class Shared_Memory_Connect_Answer_Error(MySQL_Error):
    207
    208      """Can't open shared memory; no answer event received from server."""
    209
    210 -class Shared_Memory_Connect_File_Map_Error(MySQL_Error):
    211
    212      """Can't open shared memory; server could not allocate file mapping."""
    213
    214 -class Shared_Memory_Connect_Map_Error(MySQL_Error):
    215
    216      """Can't open shared memory; server could not get pointer to file mapping."""
    217
    218 -class Shared_Memory_File_Map_Error(MySQL_Error):
    219
    220      """Can't open shared memory; client could not allocate file mapping."""
    221
    222 -class Shared_Memory_Map_Error(MySQL_Error):
    223
    224      """Can't open shared memory; client could not get pointer to file mapping."""
    225
    226 -class Shared_Memory_Event_Error(MySQL_Error):
    227
    228      """Can't open shared memory; client could not create an event."""
    229
    230 -class Shared_Memory_Connect_Abandoned_Error(MySQL_Error):
    231
    232      """Can't open shared memory; no answer from server."""
    233
    234 -class Shared_Memory_Connect_Set_Error(MySQL_Error):
    235
    236      """Can't open shared memory; cannot send request event to server."""
    237
    238 -class Conn_Unknow_Protocol(MySQL_Error):
    239
    240      """Wrong or unknown protocol."""
    241
    242 -class Invalid_Conn_Handle(MySQL_Error):
    243
    244      """Invalid connection handle."""
    245
    246 -class Secure_Auth(MySQL_Error):
    247
    248      """Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)."""
    249
    250 -class Fetch_Canceled(MySQL_Error):
    251
    252      """Row retrieval was canceled by mysql_stmt_close() call."""
    253
    254 -class No_Data(MySQL_Error):
    255
    256      """Attempt to read column without prior row fetch."""
    257
    258 -class No_Stmt_Metadata(MySQL_Error):
    259
    260      """Prepared statement contains no metadata."""
    261
    262 -class No_Result_Set(MySQL_Error):
    263
    264      """Attempt to read a row while there is no result set associated with the statement."""
    265
    266 -class Not_Implemented(MySQL_Error):
    267
    268      """This feature is not implemented yet."""
    269