Sha256: d323ae6fe466146faf8b6a3feeb98d367aa8e0aac66f217d99cfa12ee59920f1

Contents?: true

Size: 1.35 KB

Versions: 40

Compression:

Stored size: 1.35 KB

Contents

# frozen_string_literal: true

# To prevent double loading of this file when `ruby-api` is enabled
return if defined?(Wasmtime::Error)

module Wasmtime
  class Error < StandardError; end

  # Raised when failing to convert the return value of a Ruby-backed Func to
  # Wasm types.
  class ResultError < Error; end

  # Raised when converting an {Extern} to its concrete type fails.
  class ConversionError < Error; end

  # Raised on Wasm trap.
  class Trap < Error
    STACK_OVERFLOW = :stack_overflow
    MEMORY_OUT_OF_BOUNDS = :memory_out_of_bounds
    HEAP_MISALIGNED = :heap_misaligned
    TABLE_OUT_OF_BOUNDS = :table_out_of_bounds
    INDIRECT_CALL_TO_NULL = :indirect_call_to_null
    BAD_SIGNATURE = :bad_signature
    INTEGER_OVERFLOW = :integer_overflow
    INTEGER_DIVISION_BY_ZERO = :integer_division_by_zero
    BAD_CONVERSION_TO_INTEGER = :bad_conversion_to_integer
    UNREACHABLE_CODE_REACHED = :unreachable_code_reached
    INTERRUPT = :interrupt
    ALWAYS_TRAP_ADAPTER = :always_trap_adapter
    OUT_OF_FUEL = :out_of_fuel
    UNKNOWN = :unknown
  end

  # Raised when a WASI program terminates early by calling +exit+.
  class WasiExit < Error
    # @return [Integer] The system exit code.
    attr_reader(:code)

    def initialize(code)
      @code = code
    end

    # @return [String]
    def message
      "WASI exit with code #{code}"
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
wasmtime-9.0.1 lib/wasmtime/error.rb
wasmtime-9.0.1-x86_64-linux lib/wasmtime/error.rb
wasmtime-9.0.1-x86_64-linux-musl lib/wasmtime/error.rb
wasmtime-9.0.1-x86_64-darwin lib/wasmtime/error.rb
wasmtime-9.0.1-x64-mingw32 lib/wasmtime/error.rb
wasmtime-9.0.1-x64-mingw-ucrt lib/wasmtime/error.rb
wasmtime-9.0.1-arm64-darwin lib/wasmtime/error.rb
wasmtime-9.0.1-aarch64-linux lib/wasmtime/error.rb
wasmtime-8.0.0 lib/wasmtime/error.rb
wasmtime-8.0.0-x86_64-linux lib/wasmtime/error.rb
wasmtime-8.0.0-x86_64-linux-musl lib/wasmtime/error.rb
wasmtime-8.0.0-x86_64-darwin lib/wasmtime/error.rb
wasmtime-8.0.0-x64-mingw32 lib/wasmtime/error.rb
wasmtime-8.0.0-x64-mingw-ucrt lib/wasmtime/error.rb
wasmtime-8.0.0-arm64-darwin lib/wasmtime/error.rb
wasmtime-8.0.0-aarch64-linux lib/wasmtime/error.rb
wasmtime-7.0.0 lib/wasmtime/error.rb
wasmtime-7.0.0-x86_64-linux lib/wasmtime/error.rb
wasmtime-7.0.0-x86_64-linux-musl lib/wasmtime/error.rb
wasmtime-7.0.0-x86_64-darwin lib/wasmtime/error.rb