trace

Stop program with a message and source location

panic
abort
error
location
utils
moon add Yoorkin/trace@0.1.0
Download zip
Author
Version
0.1.0
License
Apache-2.0
Last updated
10 months ago
Downloads
1K
README

#Yoorkin/panic

Due to issues with WASM backend, the built-in panic and abort functions in MoonBit crash the program without providing any message or indication of where the error occurred. It's annoying to have to implement a local method for every project.

This module provides utilities to stop program execution with a message and callsite location, as a temporary workaround until MoonBit's built-in functions are improved.

#
abort

#callsite(autofill(loc))
fn[T] abort(msg : String, loc~ : SourceLoc) -> T

#
panic

#callsite(autofill(loc))
fn[T] panic(loc~ : SourceLoc) -> T

Source Files

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io