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

@@ -37,7 +37,7 @@ export class InMemoryTeamRepository implements ITeamRepository {
}
return team;
} catch (error) {
this.logger.error(`Error finding team by id ${id}:`, error);
this.logger.error(`Error finding team by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
throw error;
}
}
@@ -49,7 +49,7 @@ export class InMemoryTeamRepository implements ITeamRepository {
this.logger.info(`Found ${teams.length} teams.`);
return teams;
} catch (error) {
this.logger.error('Error finding all teams:', error);
this.logger.error('Error finding all teams:', error instanceof Error ? error : new Error(String(error)));
throw error;
}
}
@@ -63,7 +63,7 @@ export class InMemoryTeamRepository implements ITeamRepository {
this.logger.info(`Found ${teams.length} teams for league id: ${leagueId}.`);
return teams;
} catch (error) {
this.logger.error(`Error finding teams by league id ${leagueId}:`, error);
this.logger.error(`Error finding teams by league id ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
throw error;
}
}
@@ -80,7 +80,7 @@ export class InMemoryTeamRepository implements ITeamRepository {
this.logger.info(`Team ${team.id} created successfully.`);
return team;
} catch (error) {
this.logger.error(`Error creating team ${team.id}:`, error);
this.logger.error(`Error creating team ${team.id}:`, error instanceof Error ? error : new Error(String(error)));
throw error;
}
}
@@ -97,7 +97,7 @@ export class InMemoryTeamRepository implements ITeamRepository {
this.logger.info(`Team ${team.id} updated successfully.`);
return team;
} catch (error) {
this.logger.error(`Error updating team ${team.id}:`, error);
this.logger.error(`Error updating team ${team.id}:`, error instanceof Error ? error : new Error(String(error)));
throw error;
}
}
@@ -113,7 +113,7 @@ export class InMemoryTeamRepository implements ITeamRepository {
this.teams.delete(id);
this.logger.info(`Team ${id} deleted successfully.`);
} catch (error) {
this.logger.error(`Error deleting team ${id}:`, error);
this.logger.error(`Error deleting team ${id}:`, error instanceof Error ? error : new Error(String(error)));
throw error;
}
}
@@ -125,7 +125,7 @@ export class InMemoryTeamRepository implements ITeamRepository {
this.logger.debug(`Team ${id} exists: ${exists}.`);
return exists;
} catch (error) {
this.logger.error(`Error checking existence of team with id ${id}:`, error);
this.logger.error(`Error checking existence of team with id ${id}:`, error instanceof Error ? error : new Error(String(error)));
throw error;
}
}