Skip to content

Commit 37ae0f2

Browse files
committed
Better error message
1 parent a6db3b4 commit 37ae0f2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/protozoa.gleam

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,16 @@ fn parse_auto_mode(
6868
Ok(#(input, output)) -> {
6969
Ok(#(cmd, input, output, ["."]))
7070
}
71-
Error(_) -> {
71+
Error(error) -> {
7272
case cmd {
7373
Check -> {
7474
// For check mode, we can proceed even without proto files
7575
// This allows checking in projects that don't have proto files yet
7676
Ok(#(cmd, ".", ".", ["."]))
7777
}
78-
Generate -> snag.error("No gleam.toml found or no proto files detected")
78+
Generate ->
79+
Error(error)
80+
|> snag.context("No gleam.toml found or no proto files detected")
7981
}
8082
}
8183
}

0 commit comments

Comments
 (0)