From 1997f9c5572cb1617eb27836030bc9d37d30be66 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Wed, 22 Nov 2023 12:44:21 -0800 Subject: [PATCH] Remove URI from error messages --- lib/uri/generic.rb | 2 +- lib/uri/rfc3986_parser.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb index bdd3666..89a72fd 100644 --- a/lib/uri/generic.rb +++ b/lib/uri/generic.rb @@ -205,7 +205,7 @@ def initialize(scheme, end if registry raise InvalidURIError, - "the scheme #{@scheme} does not accept registry part: #{registry} (or bad hostname?)" + "the scheme #{@scheme} does not accept registry part (or bad hostname?)" end @scheme&.freeze diff --git a/lib/uri/rfc3986_parser.rb b/lib/uri/rfc3986_parser.rb index 092a1ac..0dac66b 100644 --- a/lib/uri/rfc3986_parser.rb +++ b/lib/uri/rfc3986_parser.rb @@ -78,10 +78,10 @@ def split(uri) #:nodoc: begin uri = uri.to_str rescue NoMethodError - raise InvalidURIError, "bad URI(is not URI?): #{uri.inspect}" + raise InvalidURIError, "bad URI(is not URI?)" end uri.ascii_only? or - raise InvalidURIError, "URI must be ascii only #{uri.dump}" + raise InvalidURIError, "URI must be ascii only" if m = RFC3986_URI.match(uri) query = m["query"] scheme = m["scheme"] @@ -127,7 +127,7 @@ def split(uri) #:nodoc: m["fragment"] ] else - raise InvalidURIError, "bad URI(is not URI?): #{uri.inspect}" + raise InvalidURIError, "bad URI(is not URI?)" end end