No matching definitions.

tur/panic

stdlib/panic.tur

inspect panics recovered by catch-unwind.

Since: Phase R2

defopaque

Panic

(Panic)
defn

result-panic

(result-panic [r : int] :)

extract the Panic handle from a caught (err ...) result.

rthe :int result box returned by catch-unwind / catch-panic-of

The opaque Panic handle from the err slot (0 when r is ok).

(let [r (catch-unwind (fn [] :int (panic "boom")))]
    (panic-message (result-panic r)))  ; => "boom"

Since: Phase R2

defn

panic-message

(panic-message [p : Panic] :)

the message string carried by a caught Panic.

pa Panic handle (see result-panic)

The panic message for a string panic, or "" when none is available.

Since: Phase R2

defn

panic-file

(panic-file [p : Panic] :)

source file of the panic call site.

pa Panic handle

The source file path, or "" when unknown.

Since: Phase R2

defn

panic-line

(panic-line [p : Panic] :)

source line of the panic call site.

pa Panic handle

The source line, or 0 when unknown.

Since: Phase R2

defn

panic-type

(panic-type [p : Panic] :)

the TypeKind tag of the panic payload.

pa Panic handle

The integer TypeKind of the boxed payload (e.g. the tag for :cstr for a plain string panic), or 0 when unknown.

Since: Phase R2