Trusted Contributor.
Trusted Contributor.
104 views

restful POST error handling

Hi experts,

Here's a good one: how come nobody ever whined about the fact that "bad" restful POST via doHTTPRequest() will never return a meaningful message?

I mean look:

This is a the response I get with soapUI:

{
"errorMessage": "Your request could not be created. Please check the fields have been correctly filled in. Please provide a value for required field 'Applikation'",
"i18nErrorMessage": {
"i18nKey": "sd.validation.request.creation.failure.required.field",
"parameters": ["Please provide a value for required field 'Applikation'"]
}
}

Now that is something you can easily parse / use / understand in your programming...

What you get in SM is this:

Error calling method: doHttpRequest in class: com/hp/ov/sm/server/utility/HttpClient Exception (java.io.IOException: Server returned HTTP response code: 400 fo
r URL: https://collab-dev.r-software.at/jira/rest/servicedeskapi/latest/request)

Everyone knows a trick? Am I the only dump one here? 

Please do tell me how exactly I'm supposed to get to the info that the partner system is missing the "Applikation".

I don't think that's included in the SM message...

And you can't even skip it: try - catch ist just not enough for it. If it fails, BAM, you get the red alert that's it.

How in the world can something like this happen. 2019 and we're struggling with a half-ready doHTTPRequest() which btw is the only option for a restful GET/POST...

Please prove me wrong!

BR,

Dávid

 

0 Likes
1 Reply
Highlighted
Trusted Contributor.
Trusted Contributor.

I hear this has been addressed in 9.63...

Can anybody confirm that?

Thanks in advance!

BR,

Dávid

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.