Closed bastihav closed 4 years ago
The problem is here (line 66 and 133 in CourseServiceImpl):
// Check if the lecturer does exist
userService.getUser(courseProposal.lecturerId).handleRequestHeader(addAuthenticationHeader(header)).invoke().recover {
//If the lecturer does not exist, we throw a validation error, containing that info
case ex: CustomException if ex.getErrorCode.http == 404 =>
throw new CustomException(422, DetailedError(ErrorType.Validation, courseProposal.validate :+ SimpleError("lecturerId", "Lecturer does not exist")))
Lagom maps the call intern to the path: /user-management/users/
, which does not exists.
But here is an API Problem: Vue wants to have all validation errors at the same time, this includes OwnerMismatch, not exisiting lecturer and so on
Describe the bug Trying to post a course with no lecturerId will result in a 404 (internal 404 to your user-management)
To Reproduce
results in
Expected behavior 422 with invalid params :)
Additional context Experimental cluster