Copilot commented on code in PR #3744:
URL: https://github.com/apache/thrift/pull/3744#discussion_r3840191165


##########
lib/rb/lib/thrift/protocol/json_protocol.rb:
##########
@@ -548,7 +548,11 @@ def read_json_base64
           str += "="
         end
       end
-      str.unpack1("m0")
+      begin
+        str.unpack1("m0")
+      rescue ArgumentError
+        raise ProtocolException.new(ProtocolException::INVALID_DATA, "Invalid 
Base64 data")
+      end

Review Comment:
   This conversion still does not change the RPC classification described in 
the PR: generated `process_<method>` methods call `read_args` inside 
`Processor#process`'s broad `rescue => e`, and `ProtocolException` is a 
`StandardError`, so it is rewritten as `ApplicationException::INTERNAL_ERROR` 
just like the old `ArgumentError`. The new processor spec calls `read_args` 
directly and misses this path; handle protocol exceptions before the generic 
rescue (and test the dispatched call), or narrow the claimed scope.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to