return profiler object instead of text

This commit is contained in:
Iuri Matias 2018-08-01 14:02:37 -04:00
parent 3382d929a8
commit 2d57547778

View File

@ -80,11 +80,11 @@ class Profiler {
//self.events.request('contracts:contract', req.params.contractName, res.send.bind(res));
self.events.request('contracts:contract', contractName, (contract) => {
if (!contract || !contract.deployedAddress) {
return res.send("-- couldn't profile " + contractName + " - it's not deployed or could be an interface");
return res.send({error: "-- couldn't profile " + contractName + " - it's not deployed or could be an interface"});
}
self.profile(contractName, contract, (err, table) => {
self.profileJSON(contractName, contract, (err, table) => {
if (err) {
return res.send(err);
return res.send({error: err});
}
res.send(table);
});