Maybe this should raise `pyramid.httpexceptions.HTTPBadRequest` instead? Also in the method below.