def brice_rescue(what, args = [], error = Exception, quiet = Brice.quiet)
      res = send(what, *args)

      block_given? ? yield : res
    rescue error => err
      return if quiet

      # ideally, we'd want the __FILE__ and __LINE__
      # of the rc file where the error occurred.
      location = caller.find { |c|
        c =~ %r{(?:\A|/)lib/brice/rc/} ||
        c !~ %r{(?:\A|/)lib/brice[/.]}
      }

      warn "#{err.class}: #{err} [#{location}]"

      warn err.backtrace.map { |line|
        "        from #{line}"
      }.join("\n") if Brice.verbose
    end
def brice_rescue(what, args = [], error = Exception, quiet = Brice.quiet)
      res = send(what, *args)

      block_given? ? yield : res
    rescue error => err
      return if quiet

      # ideally, we'd want the __FILE__ and __LINE__
      # of the rc file where the error occurred.
      location = caller.find { |c|
        c =~ %r{(?:\A|/)lib/brice/rc/} ||
        c !~ %r{(?:\A|/)lib/brice[/.]}
      }

      warn "#{err.class}: #{err} [#{location}]"

      warn err.backtrace.map { |line|
        "        from #{line}"
      }.join("\n") if Brice.verbose
    end
call-seq:
   brice_rescue(what[, args[, error[, quiet]]])

 Call +what+ with +args+ and rescue potential +error+, optionally
 executing block in case of success. Gives a nicer error location
 instead of the full backtrace. Doesn't warn about any errors when
 +quiet+ is +true+.

 Returns either the result of the executed method or of the block.