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/lib/google/protobuf.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'ruby/lib/google/protobuf.rb') diff --git a/ruby/lib/google/protobuf.rb b/ruby/lib/google/protobuf.rb index 4a805e88..e20a584e 100644 --- a/ruby/lib/google/protobuf.rb +++ b/ruby/lib/google/protobuf.rb @@ -37,6 +37,7 @@ module Google module Protobuf class Error < StandardError; end class ParseError < Error; end + class TypeError < ::TypeError; end end end -- cgit v1.2.3