From 74f8e24232e0d67ab79419130b5bf3a5a875593d Mon Sep 17 00:00:00 2001 From: Erik Benoist Date: Tue, 26 Jun 2018 22:24:24 -0500 Subject: Adds a base class for all explicitly raised TypeErrors (#4255) * This allows for ruby code to catch and handle Protobuf TypeErrors separately from the standard Ruby TypeError * Maintains backwards compatibility by having the new Google::Protobuf::TypeError inherit from the base TypeError. Any code that was catching TypeError should continue to work. --- ruby/ext/google/protobuf_c/message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ruby/ext/google/protobuf_c/message.c') diff --git a/ruby/ext/google/protobuf_c/message.c b/ruby/ext/google/protobuf_c/message.c index 63a61baf..3394825c 100644 --- a/ruby/ext/google/protobuf_c/message.c +++ b/ruby/ext/google/protobuf_c/message.c @@ -631,7 +631,7 @@ VALUE build_module_from_enumdesc(EnumDescriptor* enumdesc) { const char* name = upb_enum_iter_name(&it); int32_t value = upb_enum_iter_number(&it); if (name[0] < 'A' || name[0] > 'Z') { - rb_raise(rb_eTypeError, + rb_raise(cTypeError, "Enum value '%s' does not start with an uppercase letter " "as is required for Ruby constants.", name); -- cgit v1.2.3