Improve error message.
This commit is contained in:
parent
f11877f6ed
commit
3b6c0143b6
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include "td/tl/TlObject.h"
|
#include "td/tl/TlObject.h"
|
||||||
|
|
||||||
|
#include "td/utils/logging.h"
|
||||||
#include "td/utils/UInt.h"
|
#include "td/utils/UInt.h"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -21,8 +22,10 @@ class TlFetchBoxed {
|
|||||||
public:
|
public:
|
||||||
template <class ParserT>
|
template <class ParserT>
|
||||||
static auto parse(ParserT &parser) -> decltype(Func::parse(parser)) {
|
static auto parse(ParserT &parser) -> decltype(Func::parse(parser)) {
|
||||||
if (parser.fetch_int() != constructor_id) {
|
auto parsed_constructor_id = parser.fetch_int();
|
||||||
parser.set_error("Wrong constructor found");
|
if (parsed_constructor_id != constructor_id) {
|
||||||
|
parser.set_error(PSTRING() << "Wrong constructor " << parsed_constructor_id << " found instead of "
|
||||||
|
<< constructor_id);
|
||||||
return decltype(Func::parse(parser))();
|
return decltype(Func::parse(parser))();
|
||||||
}
|
}
|
||||||
return Func::parse(parser);
|
return Func::parse(parser);
|
||||||
|
Loading…
Reference in New Issue
Block a user