diff --git a/src/StreamJsonRpc/JsonRpc.cs b/src/StreamJsonRpc/JsonRpc.cs index ea125ce73..42f32b141 100644 --- a/src/StreamJsonRpc/JsonRpc.cs +++ b/src/StreamJsonRpc/JsonRpc.cs @@ -1575,7 +1575,7 @@ protected async Task InvokeCoreAsync(RequestId id, string targ } else { - throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, Resources.ResponseUnexpectedFormat, JsonConvert.SerializeObject(response))); + throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, Resources.ResponseUnexpectedFormat, response?.GetType().FullName ?? "(null)")); } } else diff --git a/src/StreamJsonRpc/Resources.resx b/src/StreamJsonRpc/Resources.resx index f61ffd63e..e87e9b73a 100644 --- a/src/StreamJsonRpc/Resources.resx +++ b/src/StreamJsonRpc/Resources.resx @@ -288,8 +288,8 @@ Failed to serialize the response. - Response is in an unexpected format. Only error and result are supported: {0} - {0} is the response message. + Response is in an unexpected format. Only error and result are supported, but received type: {0} + {0} is the response object type. Optional interface declarations should be unique. {0} has the same optional interface declared multiple times.