Inconsistent handling of errors in WebService (API)
Descriptive title for this enhancement
Inconsistent handling of errors in WebService (API)
Actual behavior
When a user can not log in using the WebService, the response is the string "Invalid user or pwd /".
When a user is logged in, this is the response: {'error': None, 'id': '123', 'result': '1k1bsnrrpntlr46622v28me1k1'}
UPDATE: Here is another of inconsistent response from the API:
Have no rights: {'id': '123', 'result': None, 'error': "Unsufficient rights for accessing type 'OGROUP'"}
Can not create user because of UID is not unique: {'id': '123', 'error': None, 'result': {'errors': ["The entry 'uid=average-joe,ou=people,dc=fusiondirectory,dc=org' already use this 'Login' attribute!"]}}
Expected behavior
Response should always be JSON, no matter if the user could log in or not.
Step by step description of new behaviour
- Log in with invalid credentials using the API.
- Observe non JSON response
- Log in with valid credentials using the API.
- Observe JSON response
Benefits
Consistency when using the API.