hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 4ef3f8f465c92471ee4739400e6092854eb5f82b
parent 59e88dfbd5e0d1d92b76214c563a258e5f7ad06a
Author: Alexey Yerin <yyp@disroot.org>
Date:   Sat, 28 Oct 2023 11:25:47 +0300

cmd/hare: Improve errors for task failure

Add full path to the module and reorder words to look more like English.

Signed-off-by: Alexey Yerin <yyp@disroot.org>

Diffstat:
Mcmd/hare/build/queue.ha | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/cmd/hare/build/queue.ha b/cmd/hare/build/queue.ha @@ -231,8 +231,14 @@ fn await_task(ctx: *context, jobs: *[]job) (size | void | error) = { if (ctx.mode == output::DEFAULT) { fmt::errorln()?; }; - fmt::fatal(ctx.mods[t.idx].name, ctx.cmds[t.kind], - exec::exitstr(e)); + if (len(ctx.mods[t.idx].ns) > 0) { + fmt::fatalf("{} for {} ({}) {}", + ctx.cmds[t.kind], ctx.mods[t.idx].name, + ctx.mods[t.idx].path, exec::exitstr(e)); + } else { + fmt::fatal(ctx.cmds[t.kind], "for", + ctx.mods[t.idx].name, exec::exitstr(e)); + }; }; cleanup_task(ctx, t)?;