mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Improved Error handling without panics
This commit is contained in:
parent
3386690f17
commit
fdc574f5f2
2 changed files with 9 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ package cmd
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/url"
|
||||
|
||||
"github.com/OpenCHAMI/magellan/pkg/crawler"
|
||||
|
|
@ -31,7 +32,7 @@ var crawlCmd = &cobra.Command{
|
|||
Insecure: cmd.Flag("insecure").Value.String() == "true",
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
log.Fatalf("Error crawling BMC: %v", err)
|
||||
}
|
||||
// Marshal the inventory details to JSON
|
||||
jsonData, err := json.MarshalIndent(systems, "", " ")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue