Skip to content

Commit

Permalink
Add detailed error logging for package endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
foucsi committed Aug 19, 2024
1 parent 968524e commit b2d5153
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/http-server/endpoints/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export async function get(req, res) {
});
}
catch (error) {
console.error(`Error occurred while fetching bundle size for package "${pkgTemplate}":`, error);
return send(res, error.statusCode, { error: error.statusMessage });

Check failure on line 24 in src/http-server/endpoints/bundle.js

View workflow job for this annotation

GitHub Actions / test (18.x, ubuntu-latest)

Expected blank line before this statement

Check failure on line 24 in src/http-server/endpoints/bundle.js

View workflow job for this annotation

GitHub Actions / test (18.x, macos-latest)

Expected blank line before this statement

Check failure on line 24 in src/http-server/endpoints/bundle.js

View workflow job for this annotation

GitHub Actions / test (18.x, windows-latest)

Expected blank line before this statement

Check failure on line 24 in src/http-server/endpoints/bundle.js

View workflow job for this annotation

GitHub Actions / test (20.x, ubuntu-latest)

Expected blank line before this statement

Check failure on line 24 in src/http-server/endpoints/bundle.js

View workflow job for this annotation

GitHub Actions / test (20.x, macos-latest)

Expected blank line before this statement

Check failure on line 24 in src/http-server/endpoints/bundle.js

View workflow job for this annotation

GitHub Actions / test (20.x, windows-latest)

Expected blank line before this statement
}
}
1 change: 1 addition & 0 deletions src/http-server/endpoints/npm-downloads.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export async function get(req, res) {
return send(res, 200, data);
}
catch (error) {
console.error(`Error occurred in npm-downloads endpoint for package "${pkgName}":`, error);
return send(res, error.statusCode, { error: error.statusMessage });

Check failure on line 15 in src/http-server/endpoints/npm-downloads.js

View workflow job for this annotation

GitHub Actions / test (18.x, ubuntu-latest)

Expected blank line before this statement

Check failure on line 15 in src/http-server/endpoints/npm-downloads.js

View workflow job for this annotation

GitHub Actions / test (18.x, macos-latest)

Expected blank line before this statement

Check failure on line 15 in src/http-server/endpoints/npm-downloads.js

View workflow job for this annotation

GitHub Actions / test (18.x, windows-latest)

Expected blank line before this statement

Check failure on line 15 in src/http-server/endpoints/npm-downloads.js

View workflow job for this annotation

GitHub Actions / test (20.x, ubuntu-latest)

Expected blank line before this statement

Check failure on line 15 in src/http-server/endpoints/npm-downloads.js

View workflow job for this annotation

GitHub Actions / test (20.x, macos-latest)

Expected blank line before this statement

Check failure on line 15 in src/http-server/endpoints/npm-downloads.js

View workflow job for this annotation

GitHub Actions / test (20.x, windows-latest)

Expected blank line before this statement
}
}

0 comments on commit b2d5153

Please sign in to comment.