@@ -637,12 +637,14 @@ func (s *ScalewayAPI) GetResponse(resource string) (*http.Response, error) {
637637 req .Header .Set ("Content-Type" , "application/json" )
638638
639639 curl , err := http2curl .GetCurlCommand (req )
640+ if err != nil {
641+ return nil , err
642+ }
640643 if os .Getenv ("SCW_SENSITIVE" ) != "1" {
641644 log .Debug (s .HideAPICredentials (curl .String ()))
642645 } else {
643646 log .Debug (curl .String ())
644647 }
645-
646648 return s .client .Do (req )
647649}
648650
@@ -663,6 +665,9 @@ func (s *ScalewayAPI) PostResponse(resource string, data interface{}) (*http.Res
663665 req .Header .Set ("Content-Type" , "application/json" )
664666
665667 curl , err := http2curl .GetCurlCommand (req )
668+ if err != nil {
669+ return nil , err
670+ }
666671 if os .Getenv ("SCW_SENSITIVE" ) != "1" {
667672 log .Debug (s .HideAPICredentials (curl .String ()))
668673 } else {
@@ -689,6 +694,9 @@ func (s *ScalewayAPI) PatchResponse(resource string, data interface{}) (*http.Re
689694 req .Header .Set ("Content-Type" , "application/json" )
690695
691696 curl , err := http2curl .GetCurlCommand (req )
697+ if err != nil {
698+ return nil , err
699+ }
692700 if os .Getenv ("SCW_SENSITIVE" ) != "1" {
693701 log .Debug (s .HideAPICredentials (curl .String ()))
694702 } else {
@@ -715,6 +723,9 @@ func (s *ScalewayAPI) PutResponse(resource string, data interface{}) (*http.Resp
715723 req .Header .Set ("Content-Type" , "application/json" )
716724
717725 curl , err := http2curl .GetCurlCommand (req )
726+ if err != nil {
727+ return nil , err
728+ }
718729 if os .Getenv ("SCW_SENSITIVE" ) != "1" {
719730 log .Debug (s .HideAPICredentials (curl .String ()))
720731 } else {
@@ -736,6 +747,9 @@ func (s *ScalewayAPI) DeleteResponse(resource string) (*http.Response, error) {
736747 req .Header .Set ("Content-Type" , "application/json" )
737748
738749 curl , err := http2curl .GetCurlCommand (req )
750+ if err != nil {
751+ return nil , err
752+ }
739753 if os .Getenv ("SCW_SENSITIVE" ) != "1" {
740754 log .Debug (s .HideAPICredentials (curl .String ()))
741755 } else {
0 commit comments