linting
This commit is contained in:
@@ -32,7 +32,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
}
|
||||
return penalty;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding penalty by id ${id}:`, error);
|
||||
this.logger.error(`Error finding penalty by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.logger.info(`Found ${penalties.length} penalties for race id: ${raceId}.`);
|
||||
return penalties;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding penalties by race id ${raceId}:`, error);
|
||||
this.logger.error(`Error finding penalties by race id ${raceId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.logger.info(`Found ${penalties.length} penalties for driver id: ${driverId}.`);
|
||||
return penalties;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding penalties by driver id ${driverId}:`, error);
|
||||
this.logger.error(`Error finding penalties by driver id ${driverId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.logger.info(`Found ${penalties.length} penalties for protest id: ${protestId}.`);
|
||||
return penalties;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding penalties by protest id ${protestId}:`, error);
|
||||
this.logger.error(`Error finding penalties by protest id ${protestId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.logger.info(`Found ${penalties.length} pending penalties.`);
|
||||
return penalties;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding pending penalties:', error);
|
||||
this.logger.error('Error finding pending penalties:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -102,7 +102,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.logger.info(`Found ${penalties.length} penalties issued by steward: ${stewardId}.`);
|
||||
return penalties;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding penalties issued by steward ${stewardId}:`, error);
|
||||
this.logger.error(`Error finding penalties issued by steward ${stewardId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.penalties.set(penalty.id, penalty);
|
||||
this.logger.info(`Penalty ${penalty.id} created successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating penalty ${penalty.id}:`, error);
|
||||
this.logger.error(`Error creating penalty ${penalty.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.penalties.set(penalty.id, penalty);
|
||||
this.logger.info(`Penalty ${penalty.id} updated successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating penalty ${penalty.id}:`, error);
|
||||
this.logger.error(`Error updating penalty ${penalty.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -144,7 +144,7 @@ export class InMemoryPenaltyRepository implements IPenaltyRepository {
|
||||
this.logger.debug(`Penalty ${id} exists: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of penalty with id ${id}:`, error);
|
||||
this.logger.error(`Error checking existence of penalty with id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user