code: def pretty_print_error(err_json):
      
      # Special case validation errors
      if len(err_json) == 1 and "validationOf" in err_json[0]:
          required_fields = ", ".join(err_json[0]["validationOf"]["required"])
          return "Validation error. Requires properties: {}.".format(required_fields)
  
      # General error handling
      msg = "; ".join(err.get("message", "") for err in err_json)
  
      # Fallback
      if not msg:
          msg = "Bad request."
      return msg
docs: Pretty print Flask-Potion error messages for the user.