update error message
This commit is contained in:
parent
752e901c65
commit
b2aa111263
|
@ -315,11 +315,20 @@ 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 {
|
||||||
|
if !strings.Contains(err.Error(), `"E_NOT_FOUND"`) {
|
||||||
|
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)
|
fmt.Fprintf(os.Stderr, "failed to register client: %s\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
grants, err = telebit.Inspect(*authURL, *token)
|
grants, err = telebit.Inspect(*authURL, *token)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
fmt.Fprintf(os.Stderr, "failed to authenticate after registering client: %s\n", err)
|
fmt.Fprintf(os.Stderr, "failed to authenticate after registering client: %s\n", err)
|
||||||
|
|
Loading…
Reference in New Issue