Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] Catch called dissector error....

From: Sebastiano Di Paola <sebastiano.dipaola@xxxxxxxxx>
Date: Sat, 30 Mar 2013 13:09:01 +0100
Hi all,
I would like to know if there is a way to call a dissector and check it's return value..I mean the behavior I would like to achieve is the following...
I have a blob of data that usually is json, but I don't have any chance to know it without trying to parse it...
So I would like to do...

<snip>
decode other part of the packet and create the subtree where to append the maybe json data...

try {
    decode the blob
}
catch { 
    cannot decode...maybe it's not json..or wrongly formatted
    and then append to the current "subtree" as a blob 
}

Is it possible to do it ? I mean trap the json dissector error/execption and then append the undecode/unkonw data as unknown to the same subtree?

Kind regards.
Ciao.
Seba