[CLIENT] Fixed an error where exception was raised too late for error responses

Closes #40