linting
This commit is contained in:
@@ -40,7 +40,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
}
|
||||
return car;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding car by ID ${id}:`, error);
|
||||
this.logger.error(`Error finding car by ID ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Successfully found ${cars.length} cars.`);
|
||||
return cars;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding all cars:', error);
|
||||
this.logger.error('Error finding all cars:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Successfully found ${cars.length} cars for game ID: ${gameId}.`);
|
||||
return cars;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding cars by game ID ${gameId}:`, error);
|
||||
this.logger.error(`Error finding cars by game ID ${gameId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Successfully found ${cars.length} cars for class: ${carClass}.`);
|
||||
return cars;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding cars by class ${carClass}:`, error);
|
||||
this.logger.error(`Error finding cars by class ${carClass}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Successfully found ${cars.length} cars for license: ${license}.`);
|
||||
return cars;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding cars by license ${license}:`, error);
|
||||
this.logger.error(`Error finding cars by license ${license}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -109,7 +109,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Successfully found ${cars.length} cars for manufacturer: ${manufacturer}.`);
|
||||
return cars;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding cars by manufacturer ${manufacturer}:`, error);
|
||||
this.logger.error(`Error finding cars by manufacturer ${manufacturer}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Successfully found ${cars.length} cars matching search query: ${query}.`);
|
||||
return cars;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error searching cars by name query ${query}:`, error);
|
||||
this.logger.error(`Error searching cars by name query ${query}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -145,7 +145,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Car ${car.id} created successfully.`);
|
||||
return car;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating car ${car.id}:`, error);
|
||||
this.logger.error(`Error creating car ${car.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -162,7 +162,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Car ${car.id} updated successfully.`);
|
||||
return car;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating car ${car.id}:`, error);
|
||||
this.logger.error(`Error updating car ${car.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -178,7 +178,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.cars.delete(id);
|
||||
this.logger.info(`Car ${id} deleted successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting car ${id}:`, error);
|
||||
this.logger.error(`Error deleting car ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -190,7 +190,7 @@ export class InMemoryCarRepository implements ICarRepository {
|
||||
this.logger.info(`Car with ID ${id} existence check: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of car with ID ${id}:`, error);
|
||||
this.logger.error(`Error checking existence of car with ID ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user