mirror of
https://github.com/criyle/go-sandbox.git
synced 2025-11-04 14:49:53 +08:00
make error better
This commit is contained in:
parent
6b97e1f663
commit
d1ed5f0f21
@ -107,6 +107,13 @@ func (m *Master) Execve(done <-chan struct{}, param *ExecveParam) (<-chan types.
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if reply2.Error != nil {
|
||||||
|
result <- types.Result{
|
||||||
|
Status: types.StatusFatal,
|
||||||
|
Error: reply2.Error.Error(),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
if reply2.ExecReply == nil {
|
if reply2.ExecReply == nil {
|
||||||
result <- types.Result{
|
result <- types.Result{
|
||||||
Status: types.StatusFatal,
|
Status: types.StatusFatal,
|
||||||
@ -115,19 +122,11 @@ func (m *Master) Execve(done <-chan struct{}, param *ExecveParam) (<-chan types.
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// emit result after all communication finish
|
// emit result after all communication finish
|
||||||
status := reply2.ExecReply.Status
|
|
||||||
errMsg := ""
|
|
||||||
if reply2.Error != nil {
|
|
||||||
status = types.StatusFatal
|
|
||||||
errMsg = reply2.Error.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
result <- types.Result{
|
result <- types.Result{
|
||||||
Status: status,
|
Status: reply2.ExecReply.Status,
|
||||||
ExitStatus: reply2.ExecReply.ExitStatus,
|
ExitStatus: reply2.ExecReply.ExitStatus,
|
||||||
UserTime: reply2.ExecReply.UserTime,
|
UserTime: reply2.ExecReply.UserTime,
|
||||||
UserMem: reply2.ExecReply.UserMem,
|
UserMem: reply2.ExecReply.UserMem,
|
||||||
Error: errMsg,
|
|
||||||
SetUpTime: mTime.Sub(sTime),
|
SetUpTime: mTime.Sub(sTime),
|
||||||
RunningTime: time.Since(mTime),
|
RunningTime: time.Since(mTime),
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user