Skip to content

Commit

Permalink
main.go: Do not unwrap the Kong error
Browse files Browse the repository at this point in the history
Kong v0.8.1 includes alecthomas/kong#384 which
fixes the issue.
  • Loading branch information
livingsilver94 committed Nov 26, 2023
1 parent 991b6bb commit 1aa2c97
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package main

import (
"errors"
"log/slog"
"os"

Expand All @@ -24,12 +23,6 @@ func main() {

err := ctx.Run()
if err != nil {
if unwrap := errors.Unwrap(err); unwrap != nil {
// kong stupidly wraps the original error with the name
// of the command that generated it. I want errors to be
// readable to users, not developers.
err = unwrap
}
slog.Error(err.Error())
os.Exit(1)
}
Expand Down

0 comments on commit 1aa2c97

Please sign in to comment.