make errors on unwrapping send a bad request to client