1
/* Copyright (C) 2003 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
19
#include <ndb_global.h>
21
#include "userInterface.h"
22
#include <NdbError.hpp>
25
#define error_handler(x,y, z) { \
26
ndbout << x << " " << y << endl; \
29
#define CHECK_MINUS_ONE(x, y, z) if(x == -1) \
30
error_handler(y,(z->getNdbError()), 0)
34
CHECK_ALLOWED_ERROR(const char * str,
35
const ThreadData * td,
36
const struct NdbError & error){
39
snprintf(buf, sizeof(buf), "subscriber = %.*s ",
40
SUBSCRIBER_NUMBER_LENGTH,
41
td->transactionData.number);
42
ndbout << str << " " << error << endl
46
switch(error.classification) {
47
case NdbError::TimeoutExpired:
48
case NdbError::OverloadError:
49
case NdbError::TemporaryResourceError:
50
case NdbError::NodeRecoveryError:
53
if(error.status != NdbError::TemporaryError)
60
CHECK_NULL(void * null,
62
const ThreadData * td,
63
const struct NdbError & err){
65
CHECK_ALLOWED_ERROR(str, td, err);
72
CHECK_NULL(void * null, const char* msg, NdbConnection* obj)
76
error_handler(msg, obj->getNdbError(), 0);