#include <ruby.h>
#include <stdexcept>
#include "detail/ruby_hacks.hpp"
#include "ruby_exceptions.ipp"
Include dependency graph for ruby_exceptions.hpp:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Namespaces | |
namespace | Exc_Ruby |
Defines | |
#define | RUBY_TRY |
Start a block to catch Ruby exceptions and rethrow them. | |
#define | RUBY_RETHROW(ex) |
Given a Ruby exception as a VALUE, safely raise the exception as a Ruby exception. This should be used inside a RUBY_TRY/RUBY_CATCH block. | |
#define | RUBY_CATCH |
End a RUBY_TRY block. |
|
Value: catch(::Exc_Ruby::Ruby_Exception const & ex) \ { \ RUBY_RETHROW(ex.ex); \ } \ catch(::Exc_Ruby::Ruby_Jump_Tag const & ex) \ { \ Exc_Ruby__ruby_jump_tag = ex.tag; \ goto Exc_Ruby__ruby_jump_tag; \ } \ catch(std::bad_alloc const & ex) \ { \ /* This won't work quite right if the rb_exc_new2 fails; not */ \ /* much we can do about that, since Ruby doesn't give us access */ \ /* to a pre-allocated NoMemoryError object */ \ RUBY_RETHROW(rb_exc_new2(rb_eNoMemError, ex.what())); \ } \ catch(std::exception const & ex) \ { \ /* This can raise a NoMemoryError in VERY rare circumstances */ \ RUBY_RETHROW(rb_exc_new2(rb_eRuntimeError, ex.what())); \ } \ catch(...) \ { \ RUBY_RETHROW(rb_exc_new2(rb_eRuntimeError, "unknown C++ exception thrown")); \ } \
|
|
Value: Exc_Ruby__ruby_exc = ex; \
goto Exc_Ruby__ruby_exception;
|
|
Value: VALUE Exc_Ruby__ruby_exc = Qnil; \ int Exc_Ruby__ruby_jump_tag = 0; \ \ goto start_of_RUBY_TRY; \ \ Exc_Ruby__ruby_exception: \ rb_exc_raise(Exc_Ruby__ruby_exc); \ Exc_Ruby__ruby_jump_tag: \ rb_jump_tag(Exc_Ruby__ruby_jump_tag); \ \ start_of_RUBY_TRY: \ try
|