requested changes

This commit is contained in:
Daniel Hougaard
2025-06-01 21:10:05 +04:00
parent 080ae5ce6f
commit b634a6c371
2 changed files with 8 additions and 2 deletions

View File

@@ -52,4 +52,6 @@ jobs:
CLI_TESTS_USER_PASSWORD: ${{ secrets.CLI_TESTS_USER_PASSWORD }}
# INFISICAL_VAULT_FILE_PASSPHRASE: ${{ secrets.CLI_TESTS_INFISICAL_VAULT_FILE_PASSPHRASE }}
run: go test -v -count=1 ./test
run: UPDATE_SNAPSHOTS=true go test -v -count=1 ./test
- name: Print updated files
run: cat ./test/.snapshots/test-TestUniversalAuth_SecretsGetWrongEnvironment

View File

@@ -33,7 +33,7 @@ type APIError struct {
func (e *APIError) Error() string {
msg := fmt.Sprintf(
"%s Unsuccessful response [%v %v] [status-code=%v] [reqId=%v]",
"%s Unsuccessful response [%v %v] [status-code=%v] [request-id=%v]",
e.Operation,
e.Method,
e.URL,
@@ -56,6 +56,10 @@ func NewAPIErrorWithResponse(operation string, res *resty.Response, additionalCo
errorMessage := util.TryParseErrorBody(res)
reqId := util.TryExtractReqId(res)
if res == nil {
return NewGenericRequestError(operation, fmt.Errorf("response is nil"))
}
apiError := &APIError{
Operation: operation,
Method: res.Request.Method,