Skip to content

Commit

Permalink
Log error
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyding committed Nov 14, 2024
1 parent bb4ef6b commit 5851b89
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
AffiliateTotalVolumeResponse,
AffiliateTotalVolumeRequest,
} from '../../../types';
import { log } from 'console';

const router: express.Router = express.Router();
const controllerName: string = 'affiliates-controller';
Expand Down Expand Up @@ -68,6 +69,12 @@ class AffiliatesController extends Controller {
if (subaccountZeroRows.length === 0) {
// error logging will be performed by handleInternalServerError
throw new UnexpectedServerError(`Subaccount 0 not found for address ${address}`);
} else if (subaccountZeroRows.length > 1) {
logger.error({
at: 'affiliates-controller#snapshot',
message: `More than 1 username exist for address: ${address}`,
subaccountZeroRows,
});
}
const subaccountId = subaccountZeroRows[0].id;

Expand Down

0 comments on commit 5851b89

Please sign in to comment.