This repository has been archived by the owner on Dec 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove unused functions Signed-off-by: Arthur Pitman <arthur.pitman@dynatrace.com> * Deduplicate constant Signed-off-by: Arthur Pitman <arthur.pitman@dynatrace.com> * Remove unneeded `fmt.Println` calls Signed-off-by: Arthur Pitman <arthur.pitman@dynatrace.com>
- Loading branch information
1 parent
6550348
commit d00898a
Showing
3 changed files
with
2 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,6 @@ | ||
package api | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/keptn/go-utils/pkg/api/models" | ||
) | ||
import v2 "github.com/keptn/go-utils/pkg/api/utils/v2" | ||
|
||
// ErrWithStatusCode message | ||
const ErrWithStatusCode = "error with status code %d" | ||
|
||
func handleErrStatusCode(statusCode int, body []byte) *models.Error { | ||
respErr := &models.Error{} | ||
if err := respErr.FromJSON(body); err == nil && respErr != nil { | ||
return respErr | ||
} | ||
|
||
return buildErrorResponse(fmt.Sprintf(ErrWithStatusCode, statusCode)) | ||
} | ||
const ErrWithStatusCode = v2.ErrWithStatusCode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters