-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add details about underlying message types on input message protocol errors #1252
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,8 +149,16 @@ export function transformInvokeImplementation< | |
const input2 = await inputIt.next(); | ||
if (input2.done !== true) { | ||
throw new ConnectError( | ||
"protocol error: received extra input message for unary method", | ||
`protocol error: received extra input message ${spec.method.I.typeName} for unary method ${spec.method.name}`, | ||
Code.Unimplemented, | ||
{ | ||
methodName: spec.method.name, | ||
serviceTypeName: spec.service.typeName, | ||
inputTypeName: spec.method.I.typeName, | ||
outputTypeName: spec.method.O.typeName, | ||
url: context.url, | ||
requestMethod: context.requestMethod, | ||
} | ||
Comment on lines
+154
to
+161
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Metadata is used for errors returned as part of the protocol, fully qualified method name should be sufficient to pin point the rpc There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I understand correctly, you are suggesting I remove this as adding metadata would interfere with other parts of the stack? I can do that. I agree that the rpc method is the main piece of information missing. |
||
); | ||
} | ||
}; | ||
|
@@ -160,8 +168,16 @@ export function transformInvokeImplementation< | |
const input1 = await inputIt.next(); | ||
if (input1.done === true) { | ||
throw new ConnectError( | ||
"protocol error: missing input message for server-streaming method", | ||
`protocol error: missing input message ${spec.method.I.typeName} for server-streaming method ${spec.method.name}`, | ||
Code.Unimplemented, | ||
{ | ||
methodName: spec.method.name, | ||
serviceTypeName: spec.service.typeName, | ||
inputTypeName: spec.method.I.typeName, | ||
outputTypeName: spec.method.O.typeName, | ||
url: context.url, | ||
requestMethod: context.requestMethod, | ||
} | ||
); | ||
} | ||
const anyFn = async ( | ||
|
@@ -207,8 +223,16 @@ export function transformInvokeImplementation< | |
const input2 = await inputIt.next(); | ||
if (input2.done !== true) { | ||
throw new ConnectError( | ||
"protocol error: received extra input message for server-streaming method", | ||
`protocol error: received extra input message ${spec.method.I.typeName} for server-streaming method ${spec.method.name}`, | ||
Code.Unimplemented, | ||
{ | ||
methodName: spec.method.name, | ||
serviceTypeName: spec.service.typeName, | ||
inputTypeName: spec.method.I.typeName, | ||
outputTypeName: spec.method.O.typeName, | ||
url: context.url, | ||
requestMethod: context.requestMethod, | ||
} | ||
); | ||
} | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fully qualified method name is unique and will be sufficient to pinpoint: