1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 01:27:03 -05:00

exit immediately on error

This commit is contained in:
Darien Raymond 2017-11-23 10:39:40 +01:00
parent 026f7e3cc2
commit 47126cc632
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -86,23 +86,24 @@ func main() {
if *plugin {
if err := core.LoadPlugins(); err != nil {
fmt.Println("Failed to load plugins:", err.Error())
return
os.Exit(-1)
}
}
server, err := startV2Ray()
if err != nil {
fmt.Println(err.Error())
return
os.Exit(-1)
}
if *test {
fmt.Println("Configuration OK.")
return
os.Exit(0)
}
if err := server.Start(); err != nil {
fmt.Println("Failed to start", err)
os.Exit(-1)
}
osSignals := make(chan os.Signal, 1)