Improved exception handling

Added AS_THROW