linting
This commit is contained in:
@@ -77,7 +77,7 @@ export class InMemoryStandingRepository implements IStandingRepository {
|
||||
this.logger.info(`Found ${standings.length} standings for league id: ${leagueId}.`);
|
||||
return standings;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding standings for league id ${leagueId}:`, error);
|
||||
this.logger.error(`Error finding standings for league id ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ export class InMemoryStandingRepository implements IStandingRepository {
|
||||
this.logger.info(`Found ${standings.length} standings.`);
|
||||
return standings;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding all standings:', error);
|
||||
this.logger.error('Error finding all standings:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -139,7 +139,7 @@ export class InMemoryStandingRepository implements IStandingRepository {
|
||||
this.logger.info(`${standings.length} standings saved successfully.`);
|
||||
return standings;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error saving many standings:`, error);
|
||||
this.logger.error(`Error saving many standings:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ export class InMemoryStandingRepository implements IStandingRepository {
|
||||
});
|
||||
this.logger.info(`Deleted ${toDelete.length} standings for league id: ${leagueId}.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting standings by league id ${leagueId}:`, error);
|
||||
this.logger.error(`Error deleting standings by league id ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -254,7 +254,7 @@ export class InMemoryStandingRepository implements IStandingRepository {
|
||||
}
|
||||
|
||||
// Add points from this result
|
||||
standing = standing.addRaceResult(result.position, pointsSystem);
|
||||
standing = standing.addRaceResult(result.position, resolvedPointsSystem);
|
||||
standingsMap.set(result.driverId, standing);
|
||||
this.logger.debug(`Driver ${result.driverId} in league ${leagueId} accumulated ${standing.points} points.`);
|
||||
});
|
||||
@@ -288,7 +288,7 @@ export class InMemoryStandingRepository implements IStandingRepository {
|
||||
|
||||
return updatedStandings;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error recalculating standings for league ${leagueId}:`, error);
|
||||
this.logger.error(`Error recalculating standings for league ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user