Skip to content

Commit

Permalink
Add some logs and change some logs messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ae2079 committed Jun 11, 2024
1 parent cf10344 commit 3435540
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
27 changes: 24 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ app.get('/givPrice', async (req: Request, res: Response) => {
givPriceInUsd
})
} catch (e: any) {
console.log('/givPrice error', {
error: e,
req,
})
res.status(400).send({errorMessage: e.message})
}
})
Expand All @@ -494,6 +498,10 @@ app.get('/purpleList', async (req: Request, res: Response) => {

res.json({purpleList: await getPurpleList()})
} catch (e: any) {
console.log('/purpleList error', {
error: e,
req,
})
res.status(400).send({errorMessage: e.message})
}
})
Expand All @@ -507,6 +515,10 @@ app.get('/givDumpers', async (req: Request, res: Response) => {
})
)
} catch (e: any) {
console.log('/givDumpers error', {
error: e,
req,
})
res.status(400).send({errorMessage: e.message})
}
})
Expand All @@ -522,7 +534,10 @@ app.get('/token_distro_assign_histories', async (req: Request, res: Response) =>
})
)
} catch (e: any) {
console.log('error happened', e)
console.log('/token_distro_assign_histories error', {
error: e,
req,
})
res.status(400).send({errorMessage: e.message})
}
})
Expand Down Expand Up @@ -794,7 +809,10 @@ app.get(`/calculate-updated`,
res.send(response)
}
} catch (e: any) {
console.log("error happened", e)
console.log('/calculate-updated error', {
error: e,
req,
})
res.status(400).send({
message: e.message
})
Expand All @@ -805,7 +823,10 @@ app.get(`/current-round`, async (req: Request, res: Response) => {
try {
const result = await getCurrentGIVbacksRound()
res.send(result)
} catch (e: any) {
} catch (e: any) {console.log('/current-round error', {
error: e,
req,
})
res.status(400).send({errorMessage: e.message})
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const createSmartContractCallAddBatchParams = async (params: {
hashParams
};
} catch (e) {
console.log('createSmartContractCallAddBatchParams', e)
console.log('createSmartContractCallAddBatchParams error', e)
throw e
}
}
Expand Down

0 comments on commit 3435540

Please sign in to comment.