linting
This commit is contained in:
@@ -38,7 +38,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
}
|
||||
return track;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding track by id ${id}:`, error);
|
||||
this.logger.error(`Error finding track by id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.info(`Found ${tracks.length} tracks.`);
|
||||
return tracks;
|
||||
} catch (error) {
|
||||
this.logger.error('Error finding all tracks:', error);
|
||||
this.logger.error('Error finding all tracks:', error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.info(`Found ${tracks.length} tracks for game id: ${gameId}.`);
|
||||
return tracks;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding tracks by game id ${gameId}:`, error);
|
||||
this.logger.error(`Error finding tracks by game id ${gameId}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -78,7 +78,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.info(`Found ${tracks.length} tracks for category: ${category}.`);
|
||||
return tracks;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding tracks by category ${category}:`, error);
|
||||
this.logger.error(`Error finding tracks by category ${category}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.info(`Found ${tracks.length} tracks for country: ${country}.`);
|
||||
return tracks;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error finding tracks by country ${country}:`, error);
|
||||
this.logger.error(`Error finding tracks by country ${country}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.info(`Found ${tracks.length} tracks matching search query: ${query}.`);
|
||||
return tracks;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error searching tracks by name query ${query}:`, error);
|
||||
this.logger.error(`Error searching tracks by name query ${query}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.info(`Track ${track.id} created successfully.`);
|
||||
return track;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error creating track ${track.id}:`, error);
|
||||
this.logger.error(`Error creating track ${track.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -144,7 +144,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.info(`Track ${track.id} updated successfully.`);
|
||||
return track;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error updating track ${track.id}:`, error);
|
||||
this.logger.error(`Error updating track ${track.id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.tracks.delete(id);
|
||||
this.logger.info(`Track ${id} deleted successfully.`);
|
||||
} catch (error) {
|
||||
this.logger.error(`Error deleting track ${id}:`, error);
|
||||
this.logger.error(`Error deleting track ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ export class InMemoryTrackRepository implements ITrackRepository {
|
||||
this.logger.debug(`Track ${id} exists: ${exists}.`);
|
||||
return exists;
|
||||
} catch (error) {
|
||||
this.logger.error(`Error checking existence of track with id ${id}:`, error);
|
||||
this.logger.error(`Error checking existence of track with id ${id}:`, error instanceof Error ? error : new Error(String(error)));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user