This commit is contained in:
2025-12-16 13:53:23 +01:00
parent 84f05598a6
commit 29dc11deb9
127 changed files with 538 additions and 547 deletions

View File

@@ -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;
}
}