-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move error classes to their own files so they can be loaded by Zeitwerk
Closes #313
- Loading branch information
Showing
6 changed files
with
40 additions
and
27 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
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,17 @@ | ||
# frozen_string_literal: true | ||
|
||
module SolidQueue | ||
module Processes | ||
class ProcessExitError < RuntimeError | ||
def initialize(status) | ||
message = case | ||
when status.exitstatus.present? then "Process pid=#{status.pid} exited with status #{status. exitstatus}" | ||
when status.signaled? then "Process pid=#{status.pid} received unhandled signal #{status. termsig}" | ||
else "Process pid=#{status.pid} exited unexpectedly" | ||
end | ||
|
||
super(message) | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module SolidQueue | ||
module Processes | ||
class ProcessMissingError < RuntimeError | ||
def initialize | ||
super("The process that was running this job no longer exists") | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
module SolidQueue | ||
module Processes | ||
class ProcessPrunedError < RuntimeError | ||
def initialize(last_heartbeat_at) | ||
super("Process was found dead and pruned (last heartbeat at: #{last_heartbeat_at}") | ||
end | ||
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