Under the functions directory of the /src/ in the symfony project , you can find functions to help you return appropriate json error responses.
If the error you're facing concerns the validation of the incoming data, return the result of the createValidationErrorResponse($errors) function
If you have any other error or exception (email already in use, ....) , return the result of the createErrorResponse($message,$status).
Under the functions directory of the /src/ in the symfony project , you can find functions to help you return appropriate json error responses. If the error you're facing concerns the validation of the incoming data, return the result of the createValidationErrorResponse($errors) function If you have any other error or exception (email already in use, ....) , return the result of the createErrorResponse($message,$status).