Skip to content

Commit

Permalink
Deprecate GoodJob::Job#recent_error (#1526)
Browse files Browse the repository at this point in the history
* Deprecate GoodJob::Job#recent_error

* Fix linter
  • Loading branch information
Wittiest authored Oct 23, 2024
1 parent 839c037 commit 1cf9b07
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/models/good_job/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,12 @@ def self.format_error(error)
# If the job has been retried, the error will be fetched from the previous {Execution} record.
# @return [String]
def recent_error
error || executions[-2]&.error
GoodJob.deprecator.warn(<<~DEPRECATION)
The `GoodJob::Job#recent_error` method is deprecated and will be removed in the next major release.
Replace usage of GoodJob::Job#recent_error with `GoodJob::Job#error`.
DEPRECATION
error
end

# Errors for the job to be displayed in the Dashboard.
Expand Down

0 comments on commit 1cf9b07

Please sign in to comment.