Adjusted error handling
This commit is contained in:
parent
0a3c465555
commit
13b599a634
|
@ -18,6 +18,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -351,6 +352,9 @@ func getSasToken(sasUrl string) (sas string, err error) {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
if resp.StatusCode != 200 {
|
||||||
|
return "", errors.New("Error at requesting SAS Token: " + resp.Status)
|
||||||
|
}
|
||||||
sasResponse, readErr := io.ReadAll(resp.Body)
|
sasResponse, readErr := io.ReadAll(resp.Body)
|
||||||
if readErr != nil {
|
if readErr != nil {
|
||||||
return "", readErr
|
return "", readErr
|
||||||
|
|
Loading…
Reference in New Issue