app/models/extface/device.rb in extface-0.1.4 vs app/models/extface/device.rb in extface-0.1.5
- old
+ new
@@ -34,12 +34,15 @@
def session(description = nil)
job = jobs.create!(description: description)
Thread.new do
begin
raise 'No driver configured' unless driver.present?
- driver.set_job(job)
- yield driver
- job.complete!
+ if driver.set_job(job)
+ yield driver
+ job.complete!
+ else
+ raise driver.errors.full_messages.join(', ')
+ end
rescue => e
STDERR.puts e.message
e.backtrace.each do |line|
p line
end