linting
This commit is contained in:
@@ -41,7 +41,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
}
|
||||
return result;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding result by id ${id}:`, error);
|
||||
this.logger.error(`Error finding result by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.info(`Found ${results.length} results.`);
|
||||
return results;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding all results:', error);
|
||||
this.logger.error('Error finding all results:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.info(`Found ${results.length} results for race id: ${raceId}.`);
|
||||
return results;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding results for race id ${raceId}:`, error);
|
||||
this.logger.error(`Error finding results for race id ${raceId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.info(`Found ${results.length} results for driver id: ${driverId}.`);
|
||||
return results;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding results for driver id ${driverId}:`, error);
|
||||
this.logger.error(`Error finding results for driver id ${driverId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.info(`Found ${results.length} results for driver ${driverId} in league ${leagueId}.`);
|
||||
return results;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding results for driver ${driverId} and league ${leagueId}:`, error);
|
||||
this.logger.error(`Error finding results for driver ${driverId} and league ${leagueId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.info(`Result ${result.id} created successfully.`);
|
||||
return result;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating result ${result.id}:`, error);
|
||||
this.logger.error(`Error creating result ${result.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -145,7 +145,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
|
||||
return created;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating many results:`, error);
|
||||
this.logger.error(`Error creating many results:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -162,7 +162,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.info(`Result ${result.id} updated successfully.`);
|
||||
return result;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating result ${result.id}:`, error);
|
||||
this.logger.error(`Error updating result ${result.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -178,7 +178,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.results.delete(id);
|
||||
this.logger.info(`Result ${id} deleted successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting result ${id}:`, error);
|
||||
this.logger.error(`Error deleting result ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -195,7 +195,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
});
|
||||
this.logger.info(`Deleted ${raceResults.length} results for race id: ${raceId}.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting results for race id ${raceId}:`, error);
|
||||
this.logger.error(`Error deleting results for race id ${raceId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -207,7 +207,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.debug(`Result ${id} exists: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of result with id ${id}:`, error);
|
||||
this.logger.error(`Error checking existence of result with id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -221,7 +221,7 @@ export class InMemoryResultRepository implements IResultRepository {
|
||||
this.logger.debug(`Results for race ${raceId} exist: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of results for race id ${raceId}:`, error);
|
||||
this.logger.error(`Error checking existence of results for race id ${raceId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user