diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2022-05-13 01:26:20 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2022-05-15 20:42:24 +0900 |
commit | acc2df9107e6531529460c7a77da07166d2d45bb (patch) | |
tree | 8cd5b0d9e30c36e63747bb398dd0350b3300562c /cmd/vartan/compile.go | |
parent | Update CHANGELOG (diff) | |
download | urubu-acc2df9107e6531529460c7a77da07166d2d45bb.tar.gz urubu-acc2df9107e6531529460c7a77da07166d2d45bb.tar.xz |
Stop handling panic to print a stack trace
Diffstat (limited to 'cmd/vartan/compile.go')
-rw-r--r-- | cmd/vartan/compile.go | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/cmd/vartan/compile.go b/cmd/vartan/compile.go index 70d01b2..e2b5f56 100644 --- a/cmd/vartan/compile.go +++ b/cmd/vartan/compile.go @@ -6,7 +6,6 @@ import ( "io/ioutil" "os" "path/filepath" - "runtime/debug" "strings" verr "github.com/nihei9/vartan/error" @@ -47,20 +46,6 @@ func runCompile(cmd *cobra.Command, args []string) (retErr error) { grmPath = args[0] } defer func() { - panicked := false - v := recover() - if v != nil { - err, ok := v.(error) - if !ok { - retErr = fmt.Errorf("an unexpected error occurred: %v", v) - fmt.Fprintf(os.Stderr, "%v:\n%v", retErr, string(debug.Stack())) - return - } - - retErr = err - panicked = true - } - if retErr != nil { specErrs, ok := retErr.(verr.SpecErrors) if ok { @@ -74,12 +59,6 @@ func runCompile(cmd *cobra.Command, args []string) (retErr error) { } } } - - if panicked { - fmt.Fprintf(os.Stderr, "%v:\n%v", retErr, string(debug.Stack())) - } else { - fmt.Fprintf(os.Stderr, "%v\n", retErr) - } } }() |