class RubyLLM::Browser::Error

Base class for every error this Gem raises deliberately.

Each subclass carries a stable, machine-readable code from the documented safe set. Messages are constructed by the Gem and never contain credentials, cookies, cdp_url values or raw page dumps.

Public Class Methods

code() click to toggle source

The stable code for this error class.

# File lib/ruby_llm/browser/errors.rb, line 12
def self.code
  const_defined?(:CODE, false) ? const_get(:CODE) : "ERROR"
end

Public Instance Methods

code() click to toggle source

The stable code for this error instance, e.g. “INVALID_INPUT”.

# File lib/ruby_llm/browser/errors.rb, line 17
def code
  self.class.code
end
to_h() click to toggle source

A model-safe representation. Callers may hand this straight back to a tool result without leaking internals.

# File lib/ruby_llm/browser/errors.rb, line 23
def to_h
  { code: code, message: message }
end