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

Expose verbose error on duplicate key in uploaded publiccode.yml #69

Open
libremente opened this issue May 28, 2019 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@libremente
Copy link
Member

libremente commented May 28, 2019

Subject of the issue

When a publiccode.yml file containing at least one duplicated key is uploaded, the editor throws an error saying Parsing error.

Steps to reproduce

Upload a publiccode.yml containing a duplicate key.

Expected behaviour

The js-yaml library has 2 possible load functions: load and safeLoad. First of all, I believe we should switch to safeLoad since it's recommended when dealing with untrusted sources. Then, safeLoad raises an Exception which we should catch and, when possible, expose the relevant error. In this particular case, the error should not be generic but it should say Parsing error: duplicate key found or something like that.

Actual behaviour

A generic error is shown and it's not possible to continue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants