From 1f92a71ea3b3d82a7df4cc4d4fc7889af0138de4 Mon Sep 17 00:00:00 2001 From: Anthony Camarillo Date: Mon, 1 Apr 2024 21:08:26 -0700 Subject: [PATCH] fix error message for readability --- broom.go | 9 +++++++-- flake.nix | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/broom.go b/broom.go index d9bbb99..3ec9eeb 100644 --- a/broom.go +++ b/broom.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "log" "os" "github.com/gdamore/tcell/v2" @@ -12,6 +13,8 @@ func InitializeMenu() { var branchesToDelete []string var path string + + pwd, _ := os.Getwd() modalIsOpen := false @@ -25,12 +28,14 @@ func InitializeMenu() { repo, err := NewGitRepositoryFromString(path) if err != nil { - panic(err) + error := fmt.Errorf("error for path %s: %s", pwd, err) + log.Fatal(error) } refs, err := NewReferences(repo) if err != nil { - panic(err) + error := fmt.Errorf("error: %s", err) + log.Fatal(error) } helpBox := tview.NewTextView() diff --git a/flake.nix b/flake.nix index 15c18fd..6d299b7 100644 --- a/flake.nix +++ b/flake.nix @@ -36,6 +36,12 @@ }; in { + devShells = { + default = pkgs.mkShell { + packages = [ pkgs.go ]; + inputsFrom = [ self.packages ]; + }; + }; packages = { inherit broom; };