Ethereal-dev: [Ethereal-dev] Throwing ReportedBoundsError to report errors other than "the pac

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Thu, 04 Aug 2005 10:50:22 -0700
In some dissectors, errors in packets are reported by explicitly throwing ReportedBoundsError.

That does, in most cases, cause a "Malformed packet" error, but, in some cases (if "pinfo->fragmented" is set), might cause an "Unreassembled packet" error instead. (The packet might be too short because it really *is* too short, i.e. whatever put it on the wire didn't put everything out; it might also be too short because it had to go into more than one link-layer frame, and the option to do reassembly wasn't done.)

That error doesn't give details of the problem with the packet.

Should we have a separate exception for those types of packet errors - one for which we use THROW_MESSAGE(), with the message giving an explicit description of the problem with the packet?