You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CdsServiceClient - unspecific error messages are returned #45
Hi,
It seems after you switched from SOAP to WebAPI backend, the error messages returned by the CdsServiceClient are very generic.
Examples:
Create entity with missing mandatory attribute:
Microsoft.Rest.HttpOperationException: 'Operation returned an invalid status code 'BadRequest''
Expected: more specific exception indicating missing/invalid attributes of entity
Create entity using impersonation - passing invalid CallerId (random Guid)
JsonReaderException: Bad JSON escape sequence: \x. Path '_error', line 1, position 170.
Expected: exception indicating that callerId is invalid
There might be more cases like that - please verify.
Some of this is a byproduct of the webAPI error reporting levels today.
the team is making progress on improving the error reporting there to be more useful.
We will have a look at the particular errors your pointing at and see if there is a miss in interfering in the client.
Took a look at this and there are a few things here..
yes.. the errors between webAPI and OrgService are not consistent, I am raising that to the API team currently.
the actual error is being reported by the CDS client.
The Exception of "Bad Request" is accurate... its a HttpOperationException, you can decode that to get to the messages.
We do attach the decoded message as LastError in the CdsService Client..
For example:
trying to create an account entry passing an invalid property results in a LastCdsError of :
************ HttpOperationException - POST contacts : User Defined |=> An error occurred while validating input parameters: Microsoft.OData.ODataException: Does not support untyped value in non-open type.
and an Exception of type HttpOperationException will be in the LastCdsExecption, and thrown if your using the basic IOrganziation Service Cmds.
** Edit:..
We are going to add a new Exception to the Client to help out with this... CdsClientOperationException. we will thow that whenever we are using the WebAPI and fault, that will allow us to move up the error message to the top of the message queue so you do not have to dig down to see it.
Activity
MattB-msft commentedon Aug 20, 2020
Some of this is a byproduct of the webAPI error reporting levels today.
the team is making progress on improving the error reporting there to be more useful.
We will have a look at the particular errors your pointing at and see if there is a miss in interfering in the client.
thanks for raising this issue.
MattB
MattB-msft commentedon Aug 20, 2020
Took a look at this and there are a few things here..
yes.. the errors between webAPI and OrgService are not consistent, I am raising that to the API team currently.
the actual error is being reported by the CDS client.
The Exception of "Bad Request" is accurate... its a HttpOperationException, you can decode that to get to the messages.
We do attach the decoded message as LastError in the CdsService Client..
For example:
trying to create an account entry passing an invalid property results in a LastCdsError of :
************ HttpOperationException - POST contacts : User Defined |=> An error occurred while validating input parameters: Microsoft.OData.ODataException: Does not support untyped value in non-open type.
and an Exception of type HttpOperationException will be in the LastCdsExecption, and thrown if your using the basic IOrganziation Service Cmds.
** Edit:..
We are going to add a new Exception to the Client to help out with this... CdsClientOperationException. we will thow that whenever we are using the WebAPI and fault, that will allow us to move up the error message to the top of the message queue so you do not have to dig down to see it.