C++ exceptions now propagate through python

This commit is contained in:
Ondrej Mikle 2014-07-19 15:54:57 +02:00
parent a8149abeec
commit 821f394602
3 changed files with 34 additions and 31 deletions

View file

@ -7,18 +7,34 @@
#include <nfc/nfc.h>
#include <nfc/nfc-types.h>
class NFCError: public std::exception
{
public:
NFCError(const std::string& msg);
const char *what() const throw() {return _msg.c_str();}
~NFCError() throw() {}
protected:
std::string _msg;
};
class NFCDevice
{
public:
NFCDevice();
NFCDevice() throw(NFCError);
virtual ~NFCDevice();
std::string scanUID();
std::string scanUID() throw(NFCError);
void open();
void open() throw(NFCError);
bool opened() const {return _opened;}
@ -43,19 +59,3 @@ protected:
};
class NFCError: public std::exception
{
public:
NFCError(const std::string& msg);
const char *what() const throw() {return _msg.c_str();}
~NFCError() throw() {}
protected:
std::string _msg;
};