getProblemCode method

String? getProblemCode()

Returns a brief problem code that can be displayed when linking to it. Returns null when URL has no problem.

Implementation

String? getProblemCode() {
  if (isInvalid) return UrlProblemCodes.invalid;
  if (!isSecure) return UrlProblemCodes.insecure;
  if (!exists) return UrlProblemCodes.missing;
  return null;
}