From f6f51799d774c2f0089ef9c64412d22be6de6c99 Mon Sep 17 00:00:00 2001 From: bytedream Date: Mon, 21 Mar 2022 17:11:01 +0100 Subject: [PATCH] Extended checking if error is context cancelling --- cmd/crunchyroll-go/cmd/root.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/crunchyroll-go/cmd/root.go b/cmd/crunchyroll-go/cmd/root.go index 3442597..25c8270 100644 --- a/cmd/crunchyroll-go/cmd/root.go +++ b/cmd/crunchyroll-go/cmd/root.go @@ -7,6 +7,7 @@ import ( "net/http" "os" "runtime/debug" + "strings" ) var ( @@ -59,7 +60,7 @@ func Execute() { } }() if err := rootCmd.Execute(); err != nil { - if err != context.Canceled { + if !strings.HasSuffix(err.Error(), context.Canceled.Error()) { out.Exit("An error occurred: %v", err) } os.Exit(1)