mirror of
https://github.com/openziti/zrok.git
synced 2024-12-23 15:18:52 +01:00
fix for enable error path (#244)
This commit is contained in:
parent
7f262f12cc
commit
fd289311bf
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/sirupsen/logrus"
|
||||
"os"
|
||||
user2 "os/user"
|
||||
"time"
|
||||
@ -93,8 +94,12 @@ func (cmd *enableCommand) run(_ *cobra.Command, args []string) {
|
||||
//Switch on err type (401, 400, 500, etc...)
|
||||
if err != nil {
|
||||
time.Sleep(250 * time.Millisecond)
|
||||
prg.Send(fmt.Sprintf("the zrok service returned an error: %v\n", err))
|
||||
prg.Quit()
|
||||
if prg != nil {
|
||||
prg.Send(fmt.Sprintf("the zrok service returned an error: %v\n", err))
|
||||
prg.Quit()
|
||||
} else {
|
||||
logrus.Errorf("the zrok service returned an error: %v", err)
|
||||
}
|
||||
<-done
|
||||
cmd.endpointError(zrd.ApiEndpoint())
|
||||
os.Exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user