Release Version 1.0.2
Another fix release, this time with a focus on error context handling. The fixed bugs mostly dealt
with handling empty messages or context stacks, see !9 for details.
In case you were unaware, there's a function called `_mb_err_ctx` that allows you to track error
context. Its function is inspired by the [`anyhow` rust crate][1] and it works
something like this:
```bash
source magic.bash
_mb_err_ctx push "failed to read user config"
loc="$(_get_user_config_file)" ||
_mb_fatal "failed to determine user config file"
config="$(_parse_user_config "$loc")" ||
_mb_fatal "failed to parse user config file"
\# ... etc.
_mb_err_ctx pop
```
Now if, in this hypothetical example, the `_parse_cli_arguments` function has
an error and exits, the error context will be printed as a series of error
messages to stderr.
This is just a contrived example of course, and you can nest error contexts to
arbitrary depth. Try it out if you want to provide helpful errors to users!
Another notable advancement in this release is the introduction of tests. In
the future we'll hopefully be able to catch regressions before they make it
into a release. That's all for today.
Happy scripting!
[1]: https://github.com/dtolnay/anyhow