-
|
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? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You are right. I consider this to be a bug. I'll convert this to an issue and hopefully patch this in a future release. Thank you for reporting! |
Beta Was this translation helpful? Give feedback.
You are right. I consider this to be a bug. I'll convert this to an issue and hopefully patch this in a future release. Thank you for reporting!