Skip to content

ParseErrorCode

Gatepost\Postcode\ParseErrorCode

Why Postcode::parse() rejected its input. The value of each case is the error code that every Gatepost SDK uses. The spec’s grammar.md defines each code.

  • Empty = 'empty': No character is left after normalisation.
  • LegacyCode = 'legacy_code': Exactly 6 digits are left. The input is an old NIPOST postcode.
  • BadCharacter = 'bad_character': A character other than A to Z and 0 to 9 is left, or the input is not valid UTF-8.
  • BadLength = 'bad_length': The input is over the input limit, or the code has a length that parse does not accept with these options.
  • UnknownState = 'unknown_state': The first two characters are not a state code.
  • BadSegment = 'bad_segment': A segment breaks its rule, such as an LGA of 00 or a digit in the area.

Unofficial. Not made or endorsed by NIPOST.