more informative errors when token is invalid

This commit is contained in:
Pavel Vorobyov
2020-01-30 12:03:13 +03:00
parent 91f776275d
commit 1168db5943
2 changed files with 3 additions and 0 deletions

View File

@@ -90,6 +90,8 @@ func (i *Inventoree) Datacenters() []*store.Datacenter {
func (i *Inventoree) Reload() error {
err := i.loadRemote()
if err != nil {
term.Errorf("\n%s\n", err)
term.Warnf("Trying to load data from cache...\n")
// trying to use cache
return i.loadLocal()
}

View File

@@ -112,6 +112,7 @@ func parseExpression(expr []rune) ([]*token, error) {
}
return nil, fmt.Errorf("Invalid symbol %s, expected -, *, %% or a hostname at position %d", string(sym), i)
case stateReadGroup:
if sym == '@' {