Skip to content

Commit 36fd62c

Browse files
author
Morgan Rodgers
committed
Improve error handling when libdrmaa is not loaded
1 parent d1da8a3 commit 36fd62c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/ood_core/job/adapters/sge/batch.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ def get_info_enqueued_job(job_id)
109109
unless results =~ /unknown_jobs/
110110
raise e, "REXML::ParseException error and command '#{argv.join(' ')}' produced results that didn't contain string 'unknown_jobs'. ParseException: #{e.message}"
111111
end
112-
rescue DRMAA::DRMAAInvalidJobError # raised when job is not found
112+
rescue StandardError => e
113+
# Note that DRMAA is not guaranteed to be defined, hence the tests
114+
raise e unless ( can_use_drmaa? && e.is_a?(DRMAA::DRMAAInvalidJobError)) # raised when job is not found
113115
end
114116

115117
job_info

0 commit comments

Comments
 (0)