lib/alma/error.rb in alma-0.2.8 vs lib/alma/error.rb in alma-0.3.1

- old
+ new

@@ -9,7 +9,18 @@ end def error @response.fetch('web_service_result', {}) end +end -end \ No newline at end of file +module Alma + class StandardError < ::StandardError + def initialize(message, loggable = {}) + if Alma.configuration.enable_loggable + message = { error: message }.merge(loggable).to_json + end + + super message + end + end +end