Skip to content

Commit

Permalink
refactor(client): add debug environment for print parseError on ID #6
Browse files Browse the repository at this point in the history
  • Loading branch information
ikr4-m committed Aug 19, 2024
1 parent 1bafc1f commit 16eafaa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/prettify_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ import (
)

func PrintErrorWithExit(instance string, err error, exitCode int) {
fmt.Println("\nFatal Error on " + instance + ":\n\t" + err.Error())
debug_env := os.Getenv("MDROP_DEBUG")

message := fmt.Sprintf("Error: %v", err.Error())
if debug_env == "1" {
message = fmt.Sprintf("\nFatal Error on %v:\n\t%v", instance, err.Error())
}

fmt.Println(message)
os.Exit(exitCode)
}

Expand Down

0 comments on commit 16eafaa

Please sign in to comment.