Sha256: 83e2e97cc2af80d4214329aa40306aa6eeb0bf9c1adaf1cbf447c03f548b1e0b

Contents?: true

Size: 754 Bytes

Versions: 7

Compression:

Stored size: 754 Bytes

Contents

module Vips

    # The ruby-vips error class. 
    class Error < RuntimeError
        # @param msg [String] The error message. If this is not supplied, grab
        #   and clear the vips error buffer and use that. 
        def initialize(msg = nil)
            if msg
                @details = msg
            elsif Vips::error_buffer != ""
                @details = Vips::error_buffer
                Vips::error_clear
            else 
                @details = nil
            end
        end

        # Pretty-print a {Vips::Error}.
        #
        # @return [String] The error message
        def to_s
            if @details != nil
                @details
            else
                super.to_s
            end
        end
    end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ruby-vips-1.0.6 lib/vips/error.rb
ruby-vips-1.0.5 lib/vips/error.rb
ruby-vips-1.0.4 lib/vips/error.rb
ruby-vips-1.0.3 lib/vips/error.rb
ruby-vips-1.0.2 lib/vips/error.rb
ruby-vips-1.0.1 lib/vips/error.rb
ruby-vips-1.0.0 lib/vips/error.rb