Sha256: ea7e192d25ad38e6ed77931fba114aaa5af1555673b3280428fea9b7ca0bc47d
Contents?: true
Size: 754 Bytes
Versions: 9
Compression:
Stored size: 754 Bytes
Contents
module Autoproj class ConfigError < RuntimeError attr_accessor :file def initialize(file = nil) super @file = file end end class InternalError < RuntimeError; end # Yields, and if the given block raises a ConfigError with no file assigned, # add that file to both the object and the exception message def self.in_file(file, exception_t = ConfigError) yield rescue exception_t => e if exception_t != ConfigError raise ConfigError.new(file), "in #{file}: #{e.message}", e.backtrace elsif !e.file e.file = file raise e, "in #{file}: #{e.message}", e.backtrace else raise e end end end
Version data entries
9 entries across 9 versions & 1 rubygems