avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From th...@apache.org
Subject [avro] branch AVRO-2186-wrong-error-message updated: Fixed error message in validating encoder/decoder and resolving decoder
Date Tue, 02 Oct 2018 17:29:20 GMT
This is an automated email from the ASF dual-hosted git repository.

thiru pushed a commit to branch AVRO-2186-wrong-error-message
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/AVRO-2186-wrong-error-message by this push:
     new 993cede  Fixed error message in validating encoder/decoder and resolving decoder
993cede is described below

commit 993cedea14eb511e6341e1ed2692112bd253e3d3
Author: Thiruvalluvan M G <thiru@startsmartlabs.com>
AuthorDate: Tue Oct 2 22:59:07 2018 +0530

    Fixed error message in validating encoder/decoder and resolving decoder
---
 lang/c++/impl/parsing/Symbol.hh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lang/c++/impl/parsing/Symbol.hh b/lang/c++/impl/parsing/Symbol.hh
index 2911752..57e2618 100644
--- a/lang/c++/impl/parsing/Symbol.hh
+++ b/lang/c++/impl/parsing/Symbol.hh
@@ -381,19 +381,19 @@ class SimpleParser {
     Handler& handler_;
     std::stack<Symbol> parsingStack;
 
-    static void throwMismatch(Symbol::Kind expected, Symbol::Kind actual)
+    static void throwMismatch(Symbol::Kind actual, Symbol::Kind expected)
     {
         std::ostringstream oss;
-        oss << "Invalid operation. Expected: " <<
-            Symbol::toString(expected) << " got " <<
+        oss << "Invalid operation. Schema requires: " <<
+            Symbol::toString(expected) << ", got: " <<
             Symbol::toString(actual);
         throw Exception(oss.str());
     }
 
-    static void assertMatch(Symbol::Kind expected, Symbol::Kind actual)
+    static void assertMatch(Symbol::Kind actual, Symbol::Kind expected)
     {
         if (expected != actual) {
-            throwMismatch(expected, actual);
+            throwMismatch(actual, expected);
         }
 
     }


Mime
View raw message