PUB_BEGIN and PUB_END macros for exception marshalling