RbError
public enum RbError: Error
extension RbError: CustomStringConvertible
An error raised by the RubyGateway module. Ruby exceptions
generate RbError.rubyException(_:)
, unusual Ruby flow control
generates RbError.rubyJump(_:)
, and the other cases correspond
to error conditions encountered by the Swift software.
Topics
Cases
case setup(String)
case setup(String)
case badType(String)
case badType(String)
An object has the wrong type for an operation.
Raised for example when setting a CVar on a non-class object.
Declaration
case badType(String)
case badParameter(String)
case badParameter(String)
A value passed to the library is out of range for some reason.
Raised for example when declaring a method with fixed arity > 15.
Declaration
case badParameter(String)
case badIdentifier(type: String, id: String)
case badIdentifier(type: String, id: String)
case duplicateKwArg(String)
case duplicateKwArg(String)
A keyword argument is duplicated.
Raised when a kwArgs
parameter is passed and the list contains duplicate argument keywords.
Declaration
case duplicateKwArg(String)
case rubyException(RbException)
case rubyException(RbException)
A Ruby exception occurred.
You are free to ignore or handle this error. If your code has been invoked from Ruby then you can also re-throw the error to pass it back down the stack.
Declaration
case rubyException(RbException)
case rubyJump(Int32)
case rubyJump(Int32)
Some Ruby flow control has happened.
Raised when you invoke a block from Swift and the block does return
or break
.
You must do any Swift-side cleanup and re-throw the error without talking to Ruby,
otherwise the Ruby runtime will become confused at best.
Declaration
case rubyJump(Int32)
Error History
class History
class History
Holds the most recent errors thrown by RubyGateway.
This can be useful when the module indicates an error has occurred
through a nil
result somewhere – the error causing the nil
has
still been generated internally and is stashed here.
These nil
results happen during type conversion to Swift, for example
String.init(_:)
, and when using the RbObjectAccess.failable
adapter that suppresses throwing.
Methods are thread-safe.
Declaration
public final class History: Sendable
static var history: RbError.History
static var history: RbError.History
A short history of errors thrown by RubyGateway
Declaration
public static let history: RbError.History
CustomStringConvertible
var description: String
var description: String