Duplicate exception classes in json parser (fpjson)
Original Reporter info from Mantis: luizamerico
-
Reporter name: Luiz Americo
Original Reporter info from Mantis: luizamerico
- Reporter name: Luiz Americo
Description:
To catch errors while using TJSONParser is necessary to handle two different exception types:
EJSONScanner from jsonparser unit
EScannerError from jsonscanner unit
This has some drawbacks:
- Need to check the exception type twice. Like:
on E: EJSONScanner do
begin
ShowMessageFmt('Error parsing "%s" : %s', [FileName, E.Message]);
end;
on E: EScannerError do
begin
ShowMessageFmt('Error parsing "%s" : %s', [FileName, E.Message]);
end;
-
Need to add jsonscanner unit to uses classes. Otherwise not needed.
-
EJSONScanner is supposed to be raised because of a parser error as pointed by Michael Van Canneyt in ML. The name is misleading.
Mantis conversion info:
- Mantis ID: 19444
- Fixed in version: 2.6.0
- Fixed in revision: 17610 (#54dbfcdd).
- Target version: 2.6.0