-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent Exception Handling #658
Labels
Comments
This is not the intended behavior. Thanks for reporting. Our team will review it and prioritize it accordingly. Internal ref: OKTA-637431 |
Any news? This is a pretty important issue |
laura-rodriguez
added a commit
that referenced
this issue
Sep 28, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug?
Normally, one would expect methods that return only data from an http call, to throw when there are errors (Such as 401,403). However, the function is returning an empty array in this case, which is misleading because that would indicate that no users were found rather than indicating a configuration problem.
Conversely when using a function that returns HTTP status and data, one would expect to get a response object, and not throw exceptions on errors, such as when calling ListUsersWithHttpInfoAsync. However, the Okta SDK throws an exception in this case when the token is invalid.
The behaviors are completely flipped. Effectively it is forcing me to use ListUsersWithHttpInfoAsync at the moment, because otherwise there would be no way to tell if the application is configured incorrectly.
What is expected to happen?
ListUsersAsync function should throw errors when the call could not be made successfully.
ListUsersWithHttpInfoAsync should not throw exceptions for non-200 responses and instead should let the caller handle the error responses.
What is the actual behavior?
ListUsersAsync returns an empty array when an HTTP error occurs.
ListUsersWithHttpInfoAsync throws an error when the provided token is invalid.
Reproduction Steps?
The description is sufficient.
Additional Information?
No response
.NET Version
7.0.306
SDK Version
6.0.11
OS version
Darwin MacBook-Pro-3.local 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000 arm64
The text was updated successfully, but these errors were encountered: