I am using node.js sdk for operations on a Baas collection. When I try to create an entity with the same name I get a 500 error. I figured out through Curl that the entity wasn't created because it was a duplicate, the name field was not unique. The code I am using is below. I only get to know if its success or error. Is there a way to get the error details?
client.createEntity(opts, function(err, o) { if (err) { res.jsonp(500, "Could not create entity.");//Need error details here return; } o.set(w); o.save(function(err) { if (err) { res.jsonp(500, err); return; } res.send(201); }); });
I guess, the 'err' argument already has the error info.. have you tried to send it back or just print to see whats the value of it?
@mukundha@apigee.com Yes, I tried passing the error object in the response. It just has a boolean value true.
Answer by Madhan+Sadasivam
·
Jul 06, 2015 at 08:36 AM
The error message from the server is not returned by the node module today.