Module: Backup::Errors

Extended by:
ErrorsHelper
Defined in:
lib/backup/errors.rb

Overview

provides cascading errors with formatted messages see the specs for details

e.g. module Backup

begin
  begin
    begin
      raise Errors::ZoneAError, 'an error occurred in Zone A'
    rescue => err
      raise Errors::ZoneBError.wrap(err, <<-EOS)
        an error occurred in Zone B

        the following error should give a reason
      EOS
    end
  rescue => err
    raise Errors::ZoneCError.wrap(err)
  end
rescue => err
  puts Errors::ZoneDError.wrap(err, 'an error occurred in Zone D')
end

end

Outputs:

ZoneDError: an error occurred in Zone D
  Reason: ZoneCError
  ZoneBError: an error occurred in Zone B

  the following error should give a reason
  Reason: ZoneAError
  an error occurred in Zone A

Defined Under Namespace

Classes: Error

Method Summary

Methods included from ErrorsHelper

const_missing