class Cause
Represents the source of the cancel operation.
Definitions
def self.backtrace
Signature
-
returns
Array(Thread::Backtrace::Location) The backtrace of the caller.
Implementation
def self.backtrace
caller_locations(2..-1)
end
def self.backtrace
Signature
-
returns
Array(String) The backtrace of the caller.
Implementation
def self.backtrace
caller(2..-1)
end
def self.for(message = "Task was cancelled!")
Create a new cause of the cancel operation, with the given message.
Signature
-
parameter
messageString The error message.
-
returns
Cause The cause of the cancel operation.
Implementation
def self.for(message = "Task was cancelled!")
instance = self.new(message)
instance.set_backtrace(self.backtrace)
return instance
end