RbException

Swift
public struct RbException: CustomStringConvertible, Error

A Ruby exception.

This provides some convenience methods on top of the underlying Exception object. RubyGateway does not throw these directly, it always wraps them in an RbError instance.

Create and throw one of these to raise a Ruby exception from a block implemented in Swift by an RbBlockCallback.


Topics

var exception: RbObject

The underlying Ruby exception object

Declaration
Swift
public let exception: RbObject

init(message: String)

Construct a new Ruby RuntimeError exception with the given message.

Use Kernel#raise directly to raise a different type of exception.

Declaration
Swift
public init(message: String)

var backtrace: [String]

The backtrace from the Ruby exception

Declaration
Swift
public var backtrace: [String] { get }

var description: String

The exception’s message

Declaration
Swift
public var description: String { get }