Skip to content

Commit

Permalink
replace throw new error with assert
Browse files Browse the repository at this point in the history
  • Loading branch information
aburkut committed Dec 27, 2024
1 parent 05d5de0 commit d85bca5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/dex/bebop/bebop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,17 @@ export class Bebop extends SimpleExchange implements IDex<BebopData> {
this.tokensAddrCacheKey = `tokens_addr`;
const token = this.dexHelper.config.data.bebopAuthToken;
const name = this.dexHelper.config.data.bebopAuthName;
if (!token || !name) {
throw new Error('Bebop auth token and name is not set');
}

assert(
token !== undefined,
'Bebop auth token is not specified with env variable',
);

assert(
name !== undefined,
'Bebop auth name is not specified with env variable',
);

this.bebopAuthName = name;
this.bebopAuthToken = token;

Expand Down

0 comments on commit d85bca5

Please sign in to comment.