Skip to content

Commit

Permalink
Send universe with errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Gebheim committed Dec 28, 2017
1 parent 2c9bec8 commit 6eaaf96
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/server/run-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ export function runServer(db: Knex, augur: Augur): RunServerResult {
const universe: Address = augur.contracts.addresses[networkId].Universe;

getMarkets(db, universe, undefined, undefined, undefined, undefined, (err: Error|null, result?: any): void => {
if (result.length === 0) throw new Error("No markets exist");

res.send( { status: "up", universe } );
if (err || result.length === 0) {
res.send( { status: "down", reason: err || "No markets found", universe });
} else {
res.send( { status: "up", universe } );
}
});
} catch(e) {
res.send({status: "down", reason: e});
Expand Down

0 comments on commit 6eaaf96

Please sign in to comment.