update error message
This commit is contained in:
parent
752e901c65
commit
b2aa111263
|
@ -315,10 +315,19 @@ func main() {
|
||||||
|
|
||||||
grants, err = telebit.Inspect(*authURL, *token)
|
grants, err = telebit.Inspect(*authURL, *token)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
|
if dbg.Debug {
|
||||||
|
fmt.Fprintf(os.Stderr, "failed to inspect token: %s\n", err)
|
||||||
|
}
|
||||||
_, err := mgmt.Register(*authURL, ClientSecret, ppid)
|
_, err := mgmt.Register(*authURL, ClientSecret, ppid)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
fmt.Fprintf(os.Stderr, "failed to register client: %s\n", err)
|
if !strings.Contains(err.Error(), `"E_NOT_FOUND"`) {
|
||||||
os.Exit(1)
|
fmt.Fprintf(os.Stderr, "invalid client credentials: %s\n", err)
|
||||||
|
os.Exit(2)
|
||||||
|
} else {
|
||||||
|
fmt.Fprintf(os.Stderr, "failed to register client: %s\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
grants, err = telebit.Inspect(*authURL, *token)
|
grants, err = telebit.Inspect(*authURL, *token)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
|
|
Loading…
Reference in New Issue