4xx codes are for client errors, here we can't be sure if it's a client or a server error.
Maybe wrap it in a try/catch and decide what return code to use based on the exception types?