Skip to content

Commit 98f7984

Browse files
committed
feat: tenanted rates endpoints - don't throw if exchange urls is not found
1 parent f1a28aa commit 98f7984

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

packages/backend/src/rates/service.ts

+5-21
Original file line numberDiff line numberDiff line change
@@ -190,27 +190,8 @@ class RatesServiceImpl implements RatesService {
190190
baseAssetCode: string,
191191
tenantId: string
192192
): Promise<Rates> {
193-
let url
194-
try {
195-
url = await this.getExchangeRatesUrl(tenantId)
196-
} catch (err) {
197-
const errorMessage = 'Could not get url for exchange rates'
198-
199-
this.deps.logger.error(
200-
{
201-
...(isAxiosError(err)
202-
? {
203-
errorMessage: err.message,
204-
errorCode: err.code,
205-
errorStatus: err.status
206-
}
207-
: { err })
208-
},
209-
errorMessage
210-
)
193+
const url = await this.getExchangeRatesUrl(tenantId)
211194

212-
throw new Error(errorMessage)
213-
}
214195
if (!url) {
215196
return { base: baseAssetCode, rates: {} }
216197
}
@@ -248,7 +229,10 @@ class RatesServiceImpl implements RatesService {
248229

249230
return tenantExchangeRatesUrl
250231
} catch (error) {
251-
this.deps.logger.error({ error }, 'Failed to get exchange rates URL')
232+
this.deps.logger.error(
233+
{ error },
234+
'Failed to get exchange rates URL from database'
235+
)
252236
}
253237
}
254238

0 commit comments

Comments
 (0)