Skip to content

Commit

Permalink
feat: do not log 400 error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-yarmosh committed Jul 25, 2024
1 parent a4f7879 commit 0075f92
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/helper/alt-ips-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ export const apiConnectAltIpsHandler = async ({ token, socketId, ip }: { token:
const results = await Promise.allSettled(addresses.map(({ address, family }) => sendToken(address, family === 'IPv6' ? 6 : 4, token, socketId)));

results.forEach((result) => {
if (result.status === 'rejected') {
logger.error(result.reason instanceof RequestError ? result.reason.message : result);
} else {
if (result.status === 'fulfilled') {
allIps.push(result.value);
} else {
if (!(result.reason instanceof RequestError)) {
logger.error(result.reason);
} else if (result.reason.code !== '400') {
logger.error(result.reason.message);
}
}
});

Expand Down

0 comments on commit 0075f92

Please sign in to comment.