mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-09-16 17:08:20 -04:00
trim err msg
This commit is contained in:
parent
c3f55dcd67
commit
e50afd6e44
@ -36,7 +36,7 @@ func Run(args []string, input io.Reader) (buf.MultiBuffer, error) {
|
||||
if err := cmd.Wait(); err != nil {
|
||||
msg := "failed to execute v2ctl"
|
||||
if errBuffer.Len() > 0 {
|
||||
msg += ": " + errBuffer.MultiBuffer.String()
|
||||
msg += ": \n" + strings.TrimSpace(errBuffer.MultiBuffer.String())
|
||||
}
|
||||
return nil, newError(msg).Base(err)
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ var (
|
||||
version = flag.Bool("version", false, "Show current version of V2Ray.")
|
||||
test = flag.Bool("test", false, "Test config file only, without launching V2Ray server.")
|
||||
format = flag.String("format", "json", "Format of input file.")
|
||||
errNoConfig = newError("no valid config")
|
||||
)
|
||||
|
||||
func fileExists(file string) bool {
|
||||
@ -134,11 +133,8 @@ func main() {
|
||||
|
||||
server, err := startV2Ray()
|
||||
if err != nil {
|
||||
fmt.Println(err.Error())
|
||||
fmt.Println(err)
|
||||
// Configuration error. Exit with a special value to prevent systemd from restarting.
|
||||
if err == errNoConfig {
|
||||
flag.PrintDefaults()
|
||||
}
|
||||
os.Exit(23)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user