-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
bugSomething isn't workingSomething isn't workingpriority-2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions
Description
hi, I'm running some API commands by passing a template. When I pass an invalid value to GitHub's API, then the underlying API command fails and I get a template error.
For example:
> gh api --preview inertia "orgs/org-that-does-not-exist/projects" --template="{{range .}}{{.name}}{{end}}"
template: :1:13: executing "" at <.name>: can't evaluate field name in type interface {}How would I do error handling in this case? As I'm using this command as part of my extension (see https://github.com/rethab/gh-project) I'd like the user not to see the template error message, but instead show the error message from GitHub's API.
In other words, the template should only be evaluated if the underlying API call was successful. Is that possible?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpriority-2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions