Adds more verbose debugging output when the RPC service hits a raisable condition. Namely, tells the consumer what actually triggered the raise in the case of a missing or invalid request method, missing API group, or missing API group method.
git-svn-id: file:///home/svn/framework3/trunk@13004 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
d4ed8d7984
commit
7a0e2ba59e
|
@ -101,7 +101,11 @@ class Service
|
|||
|
||||
begin
|
||||
if req.method != "POST"
|
||||
raise ArgumentError, "Invalid Request Verb"
|
||||
if req && req.method
|
||||
raise ArgumentError, "Invalid Request Verb: `#{req.method.inspect}'"
|
||||
else
|
||||
raise ArgumentError, "Invalid Request: `#{req.inspect}'"
|
||||
end
|
||||
end
|
||||
|
||||
if not (req.headers["Content-Type"] and req.headers["Content-Type"] == "binary/message-pack")
|
||||
|
@ -117,7 +121,7 @@ class Service
|
|||
group, funct = msg.shift.split(".", 2)
|
||||
|
||||
if not self.handlers[group]
|
||||
raise ArgumentError, "Unknown API Group"
|
||||
raise ArgumentError, "Unknown API Group: `#{group.inspect}'"
|
||||
end
|
||||
|
||||
doauth = true
|
||||
|
@ -129,7 +133,7 @@ class Service
|
|||
end
|
||||
|
||||
if not self.handlers[group].respond_to?(mname)
|
||||
raise ArgumentError, "Unknown API Call"
|
||||
raise ArgumentError, "Unknown API Call: `#{mname.inspect}'"
|
||||
end
|
||||
|
||||
if doauth
|
||||
|
|
Loading…
Reference in New Issue