{"record":{"id":"4dcb7ea3e0cca958","repo":"bensheldon/good_job","slug":"the-goodjob-job-recent-error-method-is-deprecat","errorCode":null,"errorMessage":"The `GoodJob::Job#recent_error` method is deprecated and will be removed in the next major release.\n\nReplace usage of GoodJob::Job#recent_error with `GoodJob::Job#error`.","messagePattern":"The `GoodJob::Job#recent_error` method is deprecated and will be removed in the next major release\\.\n\nReplace usage of GoodJob::Job#recent_error with `GoodJob::Job#error`\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/models/good_job/job.rb","lineNumber":589,"sourceCode":"                           else\n                             klass\n                           end\n\n        active_job_class.respond_to?(:enqueue_after_transaction_commit)\n      end\n    end\n\n    # TODO: it would be nice to enforce these values at the model\n    # validates :active_job_id, presence: true\n    # validates :scheduled_at, presence: true\n    # validates :job_class, presence: true\n    # validates :error_event, presence: true, if: -> { error.present? }\n\n    # The most recent error message.\n    # If the job has been retried, the error will be fetched from the previous {Execution} record.\n    # @return [String]\n    def recent_error\n      GoodJob.deprecator.warn(<<~DEPRECATION)\n        The `GoodJob::Job#recent_error` method is deprecated and will be removed in the next major release.\n\n        Replace usage of GoodJob::Job#recent_error with `GoodJob::Job#error`.\n      DEPRECATION\n      error\n    end\n\n    # Errors for the job to be displayed in the Dashboard.\n    # @return [String]\n    def display_error\n      return error if error.present?\n\n      serialized_params.fetch('exception_executions', {}).map do |exception, count|\n        \"#{exception}: #{count}\"\n      end.join(', ')\n    end\n\n    # Return formatted serialized_params for display in the dashboard","sourceCodeStart":571,"sourceCodeEnd":607,"githubUrl":"https://github.com/bensheldon/good_job/blob/5fcde48f8765e69901ffa9c5a06122b19c73875f/app/models/good_job/job.rb#L571-L607","documentation":"Error \"The `GoodJob::Job#recent_error` method is deprecated and will be removed in the next major release.\n\nReplace usage of GoodJob::Job#recent_error with `GoodJob::Job#error`.\" thrown in bensheldon/good_job.","triggerScenarios":"Thrown at app/models/good_job/job.rb:589 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Replace usage of GoodJob::Job#recent_error with GoodJob::Job#error.","Rename the method call before the next major release removes it."],"exampleFix":"job.error # instead of job.recent_error","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5fcde48f8765e69901ffa9c5a06122b19c73875f","analyzedAt":"2026-08-23T14:55:11.399Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}