-
-
Save jasonroelofs/271206 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Basically, I want to throw a custom exception from C++. I'm kind of lost on how to do that :/ */ | |
// exceptions.hpp | |
class V8UnknownReturnValueException : public Rice::Exception { | |
}; | |
Rice::Object rb_eUnknownReturnValueException; | |
// Initializing the guy (rb_mV8 is a defined module) | |
rb_eUnknownReturnValueException = rb_mV8.define_class<V8UnknownReturnValueException>("UnknownReturnValueException") | |
.define_constructor(Constructor<V8UnknownReturnValueException>()); | |
// Throwing the exception: | |
throw Rice::Exception(rb_eUnknownReturnValueException, "Fly little bird!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment