aboutsummaryrefslogtreecommitdiff
path: root/ruby/ext/google/protobuf_c/encode_decode.c
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2015-07-20 11:06:17 -0700
committerJoshua Haberman <jhaberman@gmail.com>2015-07-20 11:06:17 -0700
commitaba42edd8c3c5ae4edeebdacd1a3b4192bd5550f (patch)
treeb6f22f84e6109a51b59bf8092e36b69dbe9c6e49 /ruby/ext/google/protobuf_c/encode_decode.c
parent58035596e7864c66008a1f6222dce54031610ff4 (diff)
parentc2c43a4917d7da263e360a4096d6603da8535bdf (diff)
downloadprotobuf-aba42edd8c3c5ae4edeebdacd1a3b4192bd5550f.tar.gz
protobuf-aba42edd8c3c5ae4edeebdacd1a3b4192bd5550f.tar.bz2
protobuf-aba42edd8c3c5ae4edeebdacd1a3b4192bd5550f.zip
Merge pull request #604 from haberman/ruby-conformance
Added Ruby to conformance tests.
Diffstat (limited to 'ruby/ext/google/protobuf_c/encode_decode.c')
-rw-r--r--ruby/ext/google/protobuf_c/encode_decode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ruby/ext/google/protobuf_c/encode_decode.c b/ruby/ext/google/protobuf_c/encode_decode.c
index f789f6d4..e488f05b 100644
--- a/ruby/ext/google/protobuf_c/encode_decode.c
+++ b/ruby/ext/google/protobuf_c/encode_decode.c
@@ -656,8 +656,10 @@ static bool env_error_func(void* ud, const upb_status* status) {
// Free the env -- rb_raise will longjmp up the stack past the encode/decode
// function so it would not otherwise have been freed.
stackenv_uninit(se);
- rb_raise(rb_eRuntimeError, se->ruby_error_template,
- upb_status_errmsg(status));
+
+ // TODO(haberman): have a way to verify that this is actually a parse error,
+ // instead of just throwing "parse error" unconditionally.
+ rb_raise(cParseError, se->ruby_error_template, upb_status_errmsg(status));
// Never reached: rb_raise() always longjmp()s up the stack, past all of our
// code, back to Ruby.
return false;