mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 09:36:34 -05:00
exit immediately on error
This commit is contained in:
parent
026f7e3cc2
commit
47126cc632
@ -86,23 +86,24 @@ func main() {
|
|||||||
if *plugin {
|
if *plugin {
|
||||||
if err := core.LoadPlugins(); err != nil {
|
if err := core.LoadPlugins(); err != nil {
|
||||||
fmt.Println("Failed to load plugins:", err.Error())
|
fmt.Println("Failed to load plugins:", err.Error())
|
||||||
return
|
os.Exit(-1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
server, err := startV2Ray()
|
server, err := startV2Ray()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err.Error())
|
fmt.Println(err.Error())
|
||||||
return
|
os.Exit(-1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if *test {
|
if *test {
|
||||||
fmt.Println("Configuration OK.")
|
fmt.Println("Configuration OK.")
|
||||||
return
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := server.Start(); err != nil {
|
if err := server.Start(); err != nil {
|
||||||
fmt.Println("Failed to start", err)
|
fmt.Println("Failed to start", err)
|
||||||
|
os.Exit(-1)
|
||||||
}
|
}
|
||||||
|
|
||||||
osSignals := make(chan os.Signal, 1)
|
osSignals := make(chan os.Signal, 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user