Skip to content

Commit 161b133

Browse files
Do not throw error if fiat rate fetching fails
Fixes #132
1 parent 063e6bb commit 161b133

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

apps/backend/source/controllers/shared.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export class SharedController {
8282
const FIAT_VENUE = FIAT_VENUES.hasOwnProperty(req.params.fiatCurrency)
8383
? FIAT_VENUES[req.params.fiatCurrency]
8484
: 'COINGECKO';
85+
logger.info('Fiat URL: ' + FIAT_RATE_API + FIAT_VENUE + '/pairs/XBT/' + req.params.fiatCurrency);
8586
return axios
8687
.get(FIAT_RATE_API + FIAT_VENUE + '/pairs/XBT/' + req.params.fiatCurrency)
8788
.then((response: any) => {
@@ -98,10 +99,12 @@ export class SharedController {
9899
}
99100
})
100101
.catch(err => {
101-
return handleError(err, req, res, next);
102+
logger.error('Fiat Error Response: ' + JSON.stringify(err));
103+
res.status(200).json({ venue: "NONE", rate: "0" });
102104
});
103105
} catch (error: any) {
104-
handleError(error, req, res, next);
106+
logger.error('Error from Fiat Rate: ' + JSON.stringify(error));
107+
res.status(200).json({ venue: "NONE", rate: "0" });
105108
}
106109
};
107110

apps/backend/source/server.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ async function startServer() {
141141
startServer();
142142

143143
process.on('uncaughtException', err => {
144-
logger.error('I M HERE');
145144
logger.error('Uncaught Exception:', err);
146145
process.exit(1);
147146
});

0 commit comments

Comments
 (0)