Commit 932e435
committed
Cleanly distinguish Supervisor Cmd.Wait errors
The os.Process API is strange in that it returns an error instead of
(ProcessState, error). This makes it difficult to distinguish between
"regular" process errors and failures that occur while actually waiting
on the process.
Nevertheless, try to distinguish between these two cases to produce
more accurate log messages: If the error is nil or unwraps into
an *exec.ExitErr, treat it as a "regular" process error. Consider
everything else an error indicating a problem with waiting.
Signed-off-by: Tom Wieczorek <[email protected]>1 parent 5ef4a6f commit 932e435
1 file changed
+11
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
93 | 99 | | |
| 100 | + | |
94 | 101 | | |
95 | | - | |
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
| |||
0 commit comments