1 |
jgs |
82 |
/* |
2 |
|
|
****************************************************************************** |
3 |
|
|
* * |
4 |
|
|
* COPYRIGHT ACcESS 2004 - All Rights Reserved * |
5 |
|
|
* * |
6 |
|
|
* This software is the property of ACcESS. No part of this code * |
7 |
|
|
* may be copied in any form or by any means without the expressed written * |
8 |
|
|
* consent of ACcESS. Copying, use or modification of this software * |
9 |
|
|
* by any unauthorised person is illegal unless that person has a software * |
10 |
|
|
* license agreement with ACcESS. * |
11 |
|
|
* * |
12 |
|
|
****************************************************************************** |
13 |
|
|
*/ |
14 |
|
|
|
15 |
|
|
#include "finley/CPPAdapter/FinleyError.h" |
16 |
|
|
#include "finley/CPPAdapter/FinleyAdapterException.h" |
17 |
|
|
extern "C" { |
18 |
jgs |
150 |
#include "finley/finleyC/Finley.h" |
19 |
jgs |
82 |
} |
20 |
|
|
|
21 |
|
|
namespace finley { |
22 |
|
|
|
23 |
jgs |
150 |
void setFinleyError(Finley_ErrorCodeType errorCode, |
24 |
jgs |
82 |
const std::string& errMess) |
25 |
|
|
{ |
26 |
jgs |
150 |
Finley_setError(errorCode,(char*)(errMess.c_str())); |
27 |
jgs |
82 |
} |
28 |
|
|
|
29 |
|
|
void checkFinleyError() |
30 |
|
|
{ |
31 |
jgs |
150 |
if (Finley_noError()) { |
32 |
jgs |
82 |
return; |
33 |
|
|
} else { |
34 |
|
|
// |
35 |
|
|
// reset the error code to no error otherwise the next call to |
36 |
|
|
// this function may resurrect a previous error |
37 |
jgs |
150 |
Finley_resetError(); |
38 |
|
|
throw FinleyAdapterException(Finley_getErrorMessage()); |
39 |
jgs |
82 |
} |
40 |
|
|
} |
41 |
jgs |
150 |
void checkPasoError() |
42 |
|
|
{ |
43 |
|
|
if (Paso_noError()) { |
44 |
|
|
return; |
45 |
|
|
} else { |
46 |
|
|
// |
47 |
|
|
// reset the error code to no error otherwise the next call to |
48 |
|
|
// this function may resurrect a previous error |
49 |
|
|
Paso_resetError(); |
50 |
|
|
throw FinleyAdapterException(Paso_getErrorMessage()); |
51 |
|
|
} |
52 |
|
|
} |
53 |
jgs |
82 |
|
54 |
|
|
} // end of namespace |