Sha256: 73eb9dc76a568dc47ef524a5ca15ef0760decc297427b85e1b2f78faa81347d9

Contents?: true

Size: 755 Bytes

Versions: 1

Compression:

Stored size: 755 Bytes

Contents

module Vips

    # The ruby-vips8 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

1 entries across 1 versions & 1 rubygems

Version Path
ruby-vips8-0.1.0 lib/vips8/error.rb