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