Commit 38858c38 authored by Caleb Weeks's avatar Caleb Weeks

fixing error structure

parent 4faf589d
......@@ -202,7 +202,7 @@ SC.getSling = async function(path, options = {}, callback){
if(!err){
resolve(data);
}else{
reject(new Error(err));
reject(_.isString(err) ? new Error(err) : err);
}
})
})
......@@ -429,7 +429,8 @@ SC.getSling = async function(path, options = {}, callback){
obj = obj.data;
} else {
//the requested resource doesn't exists. Return "404"
err = "The requested resource doesn't exist";
obj = {statusCode: 404};
err = new Error("GetIfExists: The requested resource doesn't exist");
}
} else{
//we didn't get the response structure expected. log error, but return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment