15 |
#include "finley/CPPAdapter/FinleyError.h" |
#include "finley/CPPAdapter/FinleyError.h" |
16 |
#include "finley/CPPAdapter/FinleyAdapterException.h" |
#include "finley/CPPAdapter/FinleyAdapterException.h" |
17 |
extern "C" { |
extern "C" { |
18 |
#include "finley/finleyC/setFinleyError.h" |
#include "finley/finleyC/Finley.h" |
19 |
} |
} |
20 |
|
|
21 |
namespace finley { |
namespace finley { |
22 |
|
|
23 |
void setFinleyError(enum Finley_ErrorCodeType errorCode, |
void setFinleyError(Finley_ErrorCodeType errorCode, |
24 |
const std::string& errMess) |
const std::string& errMess) |
25 |
{ |
{ |
26 |
char message[errMess.size()+1]; |
Finley_setError(errorCode,(char*)(errMess.c_str())); |
|
strcpy(message,errMess.c_str()); |
|
|
setFinleyError(errorCode,message,errMess.size()); |
|
27 |
} |
} |
28 |
|
|
29 |
void checkFinleyError() |
void checkFinleyError() |
30 |
{ |
{ |
31 |
if (Finley_ErrorCode==NO_ERROR) { |
if (Finley_noError()) { |
32 |
return; |
return; |
33 |
} else { |
} else { |
34 |
// |
// |
35 |
// reset the error code to no error otherwise the next call to |
// reset the error code to no error otherwise the next call to |
36 |
// this function may resurrect a previous error |
// this function may resurrect a previous error |
37 |
Finley_ErrorCode=NO_ERROR; |
Finley_resetError(); |
38 |
throw FinleyAdapterException(Finley_ErrorMsg); |
throw FinleyAdapterException(Finley_getErrorMessage()); |
39 |
|
} |
40 |
|
} |
41 |
|
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 |
|
|