1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-14 21:36:25 -05:00

trim err msg

This commit is contained in:
vcptr 2019-12-31 13:29:25 +08:00
parent c3f55dcd67
commit e50afd6e44
2 changed files with 2 additions and 6 deletions

View File

@ -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)
}

View File

@ -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)
}