1 // mds_utils/python/common.i
     3 // Copyright (c) 2014 - Michele De Stefano (micdestefano@users.sourceforge.net)
     5 // Distributed under the MIT License (See accompanying file LICENSE)
    11 #include <mds_utils/python/exception.hpp>
    15 // Generic exception handler
    19    } catch (std::exception& e) {
    20         SWIG_exception(SWIG_RuntimeError,e.what());
    24 // Exception handler specific for the __getitem__ method
    25 %exception __getitem__ {
    28    } catch (mds_utils::python::index_error& e) {
    29        SWIG_exception(SWIG_IndexError,e.what());
    30    } catch (std::exception& e) {
    31         SWIG_exception(SWIG_RuntimeError,e.what());
    36 // Exception handler specific for the py_get_item method
    37 %exception py_get_item {
    40    } catch (mds_utils::python::index_error& e) {
    41        SWIG_exception(SWIG_IndexError,e.what());
    42    } catch (std::exception& e) {
    43         SWIG_exception(SWIG_RuntimeError,e.what());