]> git.8kb.co.uk Git - pgpool-ii/pgpool-ii_2.2.5/blob - pcp/pcp_error.c
Attempt to send a proper failure message to frontend when authentication
[pgpool-ii/pgpool-ii_2.2.5] / pcp / pcp_error.c
1 /*
2  * $Header: /cvsroot/pgpool/pgpool-II/pcp/pcp_error.c,v 1.2 2008/01/29 01:56:38 y-asaba Exp $
3  *
4  * pgpool: a language independent connection pool server for PostgreSQL 
5  * written by Tatsuo Ishii
6  *
7  * Copyright (c) 2003-2008      PgPool Global Development Group
8  *
9  * Permission to use, copy, modify, and distribute this software and
10  * its documentation for any purpose and without fee is hereby
11  * granted, provided that the above copyright notice appear in all
12  * copies and that both that copyright notice and this permission
13  * notice appear in supporting documentation, and that the name of the
14  * author not be used in advertising or publicity pertaining to
15  * distribution of the software without specific, written prior
16  * permission. The author makes no representations about the
17  * suitability of this software for any purpose.  It is provided "as
18  * is" without express or implied warranty.
19  *
20  * Handles errors occured in PCP modules.
21  */
22
23 #include <stdio.h>
24
25 #include "pcp.h"
26
27 ErrorCode errorcode;
28
29 void
30 pcp_errorstr(ErrorCode e)
31 {
32         switch (e)
33         {
34                 case EOFERR:
35                         fprintf(stdout, "EOFError\n");
36                         break;
37
38                 case NOMEMERR:
39                         fprintf(stdout, "NoMemoryError\n");
40                         break;
41
42                 case READERR:
43                         fprintf(stdout, "ReadError\n");
44                         break;
45
46                 case WRITEERR:
47                         fprintf(stdout, "WriteError\n");
48                         break;
49
50                 case TIMEOUTERR:
51                         fprintf(stdout, "TimeoutError\n");
52                         break;
53
54                 case INVALERR:
55                         fprintf(stdout, "InvalidArgumentError\n");
56                         break;
57
58                 case CONNERR:
59                         fprintf(stdout, "ConnectionError\n");
60                         break;
61
62                 case NOCONNERR:
63                         fprintf(stdout, "NoConnectionError\n");
64                         break;
65
66                 case SOCKERR:
67                         fprintf(stdout, "SocketError\n");
68                         break;
69
70                 case HOSTERR:
71                         fprintf(stdout, "HostError\n");
72                         break;
73
74                 case BACKENDERR:
75                         fprintf(stdout, "BackendError\n");
76                         break;
77
78                 case AUTHERR:
79                         fprintf(stdout, "AuthorizationError\n");
80                         break;
81
82                 case UNKNOWNERR:
83                 default:
84                         fprintf(stdout, "UnknownError\n");
85                         break;
86         }
87 }