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

Version Path
autoproj-1.7.3.b1 lib/autoproj/base.rb
autoproj-1.7.2 lib/autoproj/base.rb
autoproj-1.7.1 lib/autoproj/base.rb
autoproj-1.7.0 lib/autoproj/base.rb
autoproj-1.7.0.rc2 lib/autoproj/base.rb
autoproj-1.7.0.rc1 lib/autoproj/base.rb
autoproj-1.7.0.b3 lib/autoproj/base.rb
autoproj-1.7.0.b2 lib/autoproj/base.rb
autoproj-1.7.0.b1 lib/autoproj/base.rb