-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(errors): Process errors from Okta API (#11161)
Closes #11149 BEGIN_COMMIT_OVERRIDE feat(errors): Process errors from Okta API (#11161) fix(backoff): Use 2 retries with minimum 30s of backoff interval (#11161) END_COMMIT_OVERRIDE
- Loading branch information
1 parent
cf10659
commit 1f4fa5a
Showing
8 changed files
with
49 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package client | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
|
||
"github.com/okta/okta-sdk-golang/v3/okta" | ||
) | ||
|
||
func ProcessOktaAPIError(err error) error { | ||
var genericOpenAPIErr *okta.GenericOpenAPIError | ||
if errors.As(err, &genericOpenAPIErr) { | ||
return fmt.Errorf(`received error from Okta API: err: %s, body: %q model: %v`, genericOpenAPIErr.Error(), genericOpenAPIErr.Body(), genericOpenAPIErr.Model()) | ||
} | ||
|
||
return err | ||
} |
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
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
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
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