add exception handle to StringMsgParser and ParserFactory