@@ -9,23 +9,30 @@ import (
99 "github.com/sirupsen/logrus"
1010)
1111
12- func hnsCall (method , path , request string , returnResponse interface {}) error {
12+ func hnsCallRawResponse (method , path , request string ) ( * hnsResponse , error ) {
1313 var responseBuffer * uint16
1414 logrus .Debugf ("[%s]=>[%s] Request : %s" , method , path , request )
1515
1616 err := _hnsCall (method , path , request , & responseBuffer )
1717 if err != nil {
18- return hcserror .New (err , "hnsCall " , "" )
18+ return nil , hcserror .New (err , "hnsCall " , "" )
1919 }
2020 response := interop .ConvertAndFreeCoTaskMemString (responseBuffer )
2121
2222 hnsresponse := & hnsResponse {}
2323 if err = json .Unmarshal ([]byte (response ), & hnsresponse ); err != nil {
24- return err
24+ return nil , err
2525 }
26+ return hnsresponse , nil
27+ }
2628
29+ func hnsCall (method , path , request string , returnResponse interface {}) error {
30+ hnsresponse , err := hnsCallRawResponse (method , path , request )
31+ if err != nil {
32+ return fmt .Errorf ("failed during hnsCallRawResponse: %v" , err )
33+ }
2734 if ! hnsresponse .Success {
28- return fmt .Errorf ("HNS failed with error : %s" , hnsresponse .Error )
35+ return fmt .Errorf ("hns failed with error : %s" , hnsresponse .Error )
2936 }
3037
3138 if len (hnsresponse .Output ) == 0 {
0 commit comments