%module Creddy %include "exception.i" %exception { try { $action } catch (const std::exception &e) { SWIG_exception(SWIG_RuntimeError, e.what()); } } %{ #include "creddy.hh" using namespace Creddy; %} %include "creddy.h" %include "creddy.hh"