Skip to content
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

Handling 500 response from API #15

Open
wopsononock opened this issue Dec 13, 2022 · 1 comment
Open

Handling 500 response from API #15

wopsononock opened this issue Dec 13, 2022 · 1 comment

Comments

@wopsononock
Copy link

Submitting a login request to the iThenticate API with a blank username/password returns a response with a 500 status and no sid. iThenticate API documentation states that 401 is returned when no sid can be generated. Given this inconsistency, might we adapt the login method to throw an Exception on 500 or even any non 200 status?

There is an error message in the response I'm getting that actually spells out the fact that username and pass are required, so that could be used as an alternative signal of failure to login.

@wopsononock
Copy link
Author

Given the possible responses in the API docs I think throwing an exception on any non-200 code would be best. here:

if ($response['val']['me']['struct']['status']['me']['int'] === 401) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant