From 994e9eee1081e707d47713a6e2f3a58a3252c060 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Fri, 11 Oct 2019 14:28:26 -0700 Subject: [PATCH] Use RunE instead of panicking --- command/pr.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/command/pr.go b/command/pr.go index d1caadeae..3dc8821c8 100644 --- a/command/pr.go +++ b/command/pr.go @@ -26,11 +26,8 @@ work with pull requests.`, var prListCmd = &cobra.Command{ Use: "list", Short: "List pull requests", - Run: func(cmd *cobra.Command, args []string) { - err := ExecutePr() - if err != nil { - panic(err) // In the future this should handle the error better, but for now panic seems like a valid reaction - } + RunE: func(cmd *cobra.Command, args []string) error { + return ExecutePr() }, }