Skip to content

Commit

Permalink
Merge pull request #59 from curationexperts/conversion_error
Browse files Browse the repository at this point in the history
Raise a custom error when conversion fails
  • Loading branch information
mejackreed authored Apr 11, 2017
2 parents bc8b72c + dda648b commit 8916fde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/services/riiif/command_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def execute(command)
stdout.close
err = stderr.read
stderr.close
raise "Unable to execute command \"#{command}\"\n#{err}" unless wait_thr.value.success?
raise ConversionError, "Unable to execute command \"#{command}\"\n#{err}" unless wait_thr.value.success?
end
out
end
Expand Down
3 changes: 2 additions & 1 deletion lib/riiif.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require 'riiif/version'
require 'riiif/engine'

module Riiif
extend ActiveSupport::Autoload
autoload :Image
Expand All @@ -19,6 +18,8 @@ def initialize(orig = nil)
@original_exception = orig
end
end
# This error is raised when Riiif can't convert an image
class ConversionError < Error; end

Transformation = Struct.new(:crop, :size, :quality, :rotation, :format)
ImageInformation = Struct.new(:width, :height)
Expand Down

0 comments on commit 8916fde

Please sign in to comment.