change the errors method to adopt the new swagger-ui api