return profiler object instead of text

This commit is contained in:
Iuri Matias 2018-08-01 14:02:37 -04:00 committed by Pascal Precht
parent 7e96eb661e
commit efbe71f5e2
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 3 additions and 3 deletions

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);
});