Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle the case where package meta has missing fields. #3

Open
kasipavankumar opened this issue Dec 26, 2021 · 0 comments
Open

Handle the case where package meta has missing fields. #3

kasipavankumar opened this issue Dec 26, 2021 · 0 comments
Assignees
Labels
🐛 Bug Something isn't working ❓ Question Further information is requested

Comments

@kasipavankumar
Copy link
Member

Issue

When there are fields missing from the package meta that is provided during package publish flow, API currently throws 500 error, which ideally should be gracefully handled.

Point of error

const { name, version, dependencies, author } = packageMeta

Solution

We should catch & respond to this issue while executing the process-package-meta middleware. This would cause an early exit from the flow & also prevent the uploading of the package to the repository.

const jsonParsedMeta = JSON.parse(packageMeta?.buffer?.toString())

@kasipavankumar kasipavankumar added 🐛 Bug Something isn't working ❓ Question Further information is requested labels Dec 26, 2021
@kasipavankumar kasipavankumar self-assigned this Dec 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working ❓ Question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant