[QFJ-65] Wrong error reported on parse Created: 06/Sep/06 Updated: 12/Apr/07 Resolved: 11/Feb/07 | 
    |
| Status: | Closed | 
| Project: | QuickFIX/J | 
| Component/s: | Engine | 
| Affects Version/s: | 1.0.3 | 
| Fix Version/s: | 1.1.0 | 
| Type: | Bug | Priority: | Default | 
| Reporter: | André Malenfant | Assignee: | Steve Bate | 
| Resolution: | Fixed | Votes: | 0 | 
| Labels: | None | ||
| Description | 
| 
             Whenever a parsing error occurs, an InvalidMessage exception is thrown but is never reported and the processing continues to the validation method which may or not find a validation error. If, for instance, a LENGTH type field is missing for a specific DATA field, the error reported is: Invalid message: Actual body length=x, Expected body length=x whereas the real error is that the LENGTH field is missing. form the fromString method of the Message class: try { parseHeader(dd); parseBody(dd); parseTrailer(dd); }catch (InvalidMessage e) { isValidStructure = false; }if (doValidation) { validate(messageData); } | 
    
| Comments | 
| Comment by John McKeown [ 05/Dec/06 ] | 
| 
             This issue can be easily reproduced by parsing a message which has the MsgType field in the wrong place (i.e. not the third field).  | 
| Comment by Steve Bate [ 11/Feb/07 ] | 
| 
             The message parser will now report the correct error. I've added a unit test for the specific case of a missing data field length.  |