Record Class LastCrash
java.lang.Object
java.lang.Record
com.botwithus.bot.api.runtime.LastCrash
Immutable record describing a single script failure: the lifecycle phase in
which the throwable surfaced, the loop iteration index at the time, the
wall-clock
Instant the runner observed it, and the throwable itself.
The iteration field is the loop counter at crash time. For
crashes outside Phase.ON_LOOP the value is the most recent loop
count observed by the profiler — useful for ordering but not load-bearing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncause()Returns the value of thecauserecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of theiterationrecord component.phase()Returns the value of thephaserecord component.Renders the throwable as the conventional multi-line stack trace string.final StringtoString()Returns a string representation of this record class.when()Returns the value of thewhenrecord component.
-
Constructor Details
-
LastCrash
Creates an instance of aLastCrashrecord class.- Parameters:
phase- the value for thephaserecord componentiteration- the value for theiterationrecord componentwhen- the value for thewhenrecord componentcause- the value for thecauserecord component
-
-
Method Details
-
stackTrace
Renders the throwable as the conventional multi-line stack trace string. Suitable for direct display in GUI surfaces (collapsing-header bodies, log lines, notification tooltips). -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
phase
Returns the value of thephaserecord component.- Returns:
- the value of the
phaserecord component
-
iteration
public long iteration()Returns the value of theiterationrecord component.- Returns:
- the value of the
iterationrecord component
-
when
Returns the value of thewhenrecord component.- Returns:
- the value of the
whenrecord component
-
cause
Returns the value of thecauserecord component.- Returns:
- the value of the
causerecord component
-