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, "        an error occurred in Zone B\n\n        the following error should give a reason\n      EOS\n    end\n  rescue => err\n    raise Errors::ZoneCError.wrap(err)\n  end\nrescue => err\n  puts Errors::ZoneDError.wrap(err, 'an error occurred in Zone D')\nend\n")

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