Skip to content

Commit

Permalink
[log] add exit code
Browse files Browse the repository at this point in the history
Co-Authored-By: Alireza Ahmadi <[email protected]>
  • Loading branch information
MHSanaei and alireza0 committed Apr 1, 2024
1 parent 9d18e92 commit 9454af4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xray/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,14 @@ func (p *process) Start() (err error) {

defer func() {
if err != nil {
logger.Error("Failure in running xray-core process: ", err)
p.exitErr = err
}
}()

data, err := json.MarshalIndent(p.config, "", " ")
if err != nil {
return common.NewErrorf("Failed to generate xray configuration file: %v", err)
return common.NewErrorf("Failed to generate XRAY configuration files: %v", err)
}

err = os.MkdirAll(config.GetLogFolder(), 0o770)
Expand All @@ -223,6 +224,7 @@ func (p *process) Start() (err error) {
go func() {
err := cmd.Run()
if err != nil {
logger.Error("Failure in running xray-core: ", err)
p.exitErr = err
}
}()
Expand Down

0 comments on commit 9454af4

Please sign in to comment.