data TraceFrame
One frame of an error trace: the function containing the ?, its file and line.
Example:
@error data Boom {}
fn inner() -> () | Boom {
fail Boom{}
}
fn outer() -> () | Boom {
inner()?
}
fn main() io {
match outer() {
Boom b => {
let f = b.trace()[0]
print("{f.r#fn} {f.line > 0}")
}
_ => {}
}
}Вывод
outer true
pub(api) data TraceFrameС версии. 1.0.0-beta
Поля
pub(api) r#fn: str | Name of the function that contains the |
pub(api) file: str | Source file. |
pub(api) line: i64 | Line of the |
Определено в: std/core/types.oxl:981