Skip to content

Commit 18dd153

Browse files
committed
Improve message for ProcessExitError exception
To show as much information as possible.
1 parent 940c6ac commit 18dd153

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/solid_queue/processes/process_exit_error.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ module SolidQueue
44
module Processes
55
class ProcessExitError < RuntimeError
66
def initialize(status)
7-
message = case
8-
when status.exitstatus.present? then "Process pid=#{status.pid} exited with status #{status. exitstatus}"
9-
when status.signaled? then "Process pid=#{status.pid} received unhandled signal #{status. termsig}"
10-
else "Process pid=#{status.pid} exited unexpectedly"
7+
message = "Process pid=#{status.pid} exited unexpectedly."
8+
if status.exitstatus.present?
9+
message += " Exited with status #{status.exitstatus}."
10+
end
11+
12+
if status.signaled?
13+
message += " Received unhandled signal #{status.termsig}."
1114
end
1215

1316
super(message)

0 commit comments

Comments
 (0)