Hi,
I am using content server 16.2 and doing some rest api calls using jquery.
i use this code in the error callback function : alert(error.responseJSON.error);
You can see below the entire ajax code.
When I run the ajax call against content server machine (version 16.0) its returning descriptive error like ("The file alredy exist") - which is great.
but when i run this on a 16.2 machine, the error.responseJSON object is undefined, and the error.responseText just specify it is a "bad request".
How can I configure the 16.2 machine to give me descriptive errors in the callback function like the cs16.0 machine?
Thanks,
Yaron
-----------------------------------------------------------------------------
$.ajax({
type: "POST",
url: baseresturl+"nodes",
data: formData,
contentType: false,
processData: false,
crossDomain: true,
dataType: "json",
beforeSend: function (request) {
request.setRequestHeader("OTCSTicket", otcs_ticket),
request.overrideMimeType("multipart/form-data"),
request.getAllResponseHeaders()
},
success: function (response) {
$("#dvStatus").html("<span style='direction: ltr;'>" + response.id + "</span>");
},
error: function (error) {
alert(error.responseJSON.error);
}
});