Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Fixing arity mismatch for ImportUrlJob#send_error
Browse files Browse the repository at this point in the history
In v2.9.6 of Hyrax we saw the following error:

> File Import Error
>   Error: wrong number of arguments (given 2, expected 1)

It masks other errors, because the message sending for errors is itself
raising an error.

With this change, we ignore all extra parameters and pass the first
parameter.

Related to:

- samvera/hyrax#2821

Resolved in:

- samvera/hyrax#4243
- samvera/hyrax@bfd316e
  • Loading branch information
jeremyf committed Apr 10, 2023
1 parent 3c6a329 commit 7b21584
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/jobs/import_url_job_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# OVERRIDE in v2.9.6 of Hyrax
module ImportUrlJobDecorator
# OVERRIDE there are calls to send_error that send two arguments.
#
# @see https://github.com/samvera/hyrax/blob/426575a9065a5dd3b30f458f5589a0a705ad7be2/app/jobs/import_url_job.rb#L76-L105
def send_error(error_message, *args)
super(error_message)
end
end

ImportUrlJob.prepend(ImportUrlJobDecorator)

0 comments on commit 7b21584

Please sign in to comment.