Class: Net::IMAP::InvalidParseData
| Relationships & Source Files | |
| Inherits: | Object |
| Defined in: | lib/net/imap/response_data.rb |
Overview
Note: This represents an intentionally unstable API. Where instances of this class are returned, future releases may return a different (incompatible) object without deprecation or warning.
When the response parser encounters a recoverable error,
InvalidParseData represents that portion of the response which
could not be parsed, allowing the parser to parse the remainder of the
response. InvalidParseData is always associated with a ResponseParseError
which has been rescued.
This could be caused by a malformed server response, by a bug in
ResponseParser, or by an unsupported extension to the response
syntax. For example, if a server supports UIDPLUS, but sends an invalid
COPYUID response code:
parser = Net::IMAP::ResponseParser.new
parsed = parser.parse "* OK [COPYUID 701 ] copied one message\r\n"
parsed => {
data: Net::IMAP::ResponseText(
code: Net::IMAP::ResponseCode(
name: "COPYUID",
data: Net::IMAP::InvalidParseData(
parse_error: Net::IMAP::ResponseParseError,
unparsed_data: "701 ",
parsed_data: nil,
)
)
)
}
In this example, although [COPYUID 701 ] uses valid syntax for a
generic ResponseCode, it is invalid syntax for a COPYUID response
code.
See also: UnparsedData, ExtensionData