Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Snapctl task create needs more detailed error message from malformed input files #1137

Closed
ssorsa opened this issue Aug 12, 2016 · 2 comments
Closed

Comments

@ssorsa
Copy link
Contributor

ssorsa commented Aug 12, 2016

When user creates a task in snapctl: "snapctl task create -t task.json" and the input format is malformed the error message that the user is given for some errors is:

Using task manifest to create task
Error parsing JSON file input - json: cannot unmarshal string into Go value of type map[string]interface {}

Even a line number would be useful in this situation. Now the user needs to figure out the correct line where the error lies. In namespace error the message is:

Error creating task:Invalid namespace: intel/proc

When the user is missing the first "/". This line gives more information for correcting the issue compared to the "Error parsing JSON file input - json: cannot unmarshal string into Go value of type map[string]interface {}".

I'm asking if the line number from malformed input file would be added to the error message.

@IRCody
Copy link
Contributor

IRCody commented Aug 12, 2016

@ssorsa: Thanks for the feedback. Better error messages definitely improve the user experience.

I'm asking if the line number from malformed input file would be added to the error message.

I think this is a good idea. I am adding an enhancement label to this issue so it can hopefully be added in the future.

@nanliu
Copy link
Contributor

nanliu commented Dec 22, 2016

Maybe this package can provide a more human friendly error: https://godoc.org/go4.org/errorutil

Alrim42 added a commit to Alrim42/snap that referenced this issue Aug 2, 2017
Alrim42 added a commit to Alrim42/snap that referenced this issue Aug 2, 2017
Alrim42 added a commit to Alrim42/snap that referenced this issue Aug 2, 2017
Alrim42 added a commit to Alrim42/snap that referenced this issue Aug 2, 2017
Alrim42 added a commit to Alrim42/snap that referenced this issue Aug 3, 2017
Alrim42 added a commit to Alrim42/snap that referenced this issue Aug 3, 2017
mkleina pushed a commit that referenced this issue Aug 3, 2017
Closes #1137 - more detailed error message
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants