-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
Process::Status#description
(#15468)
In the compiler we have a neat feature that shows a human readable description when a process process exited with an abnormal status. This patch moves this as a gernal tool into stdlib as `Process::Status#description`. The implementation is split into two parts: * `Process::ExitReason#description` provides the static description for most exit reasons. * `Process::Status#description` enhances that description with details about the termination signal when it's a signal exit without further specification. Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
- Loading branch information
1 parent
b847480
commit fbb005d
Showing
4 changed files
with
85 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require "spec" | ||
|
||
describe Process::ExitReason do | ||
describe "#description" do | ||
it "with exit status" do | ||
Process::ExitReason::Normal.description.should eq "Process exited normally" | ||
Process::ExitReason::Unknown.description.should eq "Process terminated abnormally, the cause is unknown" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters