Skip to content

Commit

Permalink
fix: improve error logging during download retries
Browse files Browse the repository at this point in the history
  • Loading branch information
maehr committed Oct 15, 2024
1 parent baeb587 commit 9c5c69b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib/downloadManager.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { dev } from '$app/environment';
import fs from 'fs';
import fetch from 'node-fetch';
import path from 'path';
Expand Down Expand Up @@ -96,9 +95,7 @@ class DownloadManager {
console.log(`Downloaded ${url} to ${path.join(outputPath, fileName)}`);
} catch (e) {
if (retries > 0) {
if (dev) {
console.error(e);
}
console.error(`Error: ${e.message}`);
console.log(`Retrying download for ${url}. Retries left: ${retries - 1}`);
await this.download(url, staticDir, retries - 1);
} else {
Expand Down

0 comments on commit 9c5c69b

Please sign in to comment.