mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 11:37:01 -07:00
Added checks for connectGofish to prevent panics
This commit is contained in:
parent
f59d68797d
commit
4d6ffd213b
1 changed files with 10 additions and 5 deletions
|
|
@ -632,11 +632,16 @@ func QueryProcessors(q *QueryParams) ([]byte, error) {
|
||||||
func connectGofish(q *QueryParams) (*gofish.APIClient, error) {
|
func connectGofish(q *QueryParams) (*gofish.APIClient, error) {
|
||||||
config := makeGofishConfig(q)
|
config := makeGofishConfig(q)
|
||||||
c, err := gofish.Connect(config)
|
c, err := gofish.Connect(config)
|
||||||
c.Service.ProtocolFeaturesSupported = gofish.ProtocolFeaturesSupported{
|
if err != nil {
|
||||||
ExpandQuery: gofish.Expand{
|
return nil, fmt.Errorf("could not connect to redfish endpoint: %v", err)
|
||||||
ExpandAll: true,
|
}
|
||||||
Links: true,
|
if c != nil {
|
||||||
},
|
c.Service.ProtocolFeaturesSupported = gofish.ProtocolFeaturesSupported{
|
||||||
|
ExpandQuery: gofish.Expand{
|
||||||
|
ExpandAll: true,
|
||||||
|
Links: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return c, err
|
return c, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue