From: Andrey Goder <agoder@fb.com>
Date: Wed, 29 Jul 2015 15:24:28 +0000 (-0700)
Subject: Add space to error message
X-Git-Tag: v0.53.0~38
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b4ff87eeb136c642a80bc5ae83b989c97c7c29f4;p=folly.git

Add space to error message

Summary: Before this change you would get an error like:
"Expected to get greater than or equal to1 for value 0"

Now it add in the space correctly:
"Expected to get greater than or equal to 1 for value 0"

Reviewed By: @snarkmaster

Differential Revision: D2288454
---

diff --git a/folly/experimental/JSONSchema.cpp b/folly/experimental/JSONSchema.cpp
index 9283ee36..af97dac7 100644
--- a/folly/experimental/JSONSchema.cpp
+++ b/folly/experimental/JSONSchema.cpp
@@ -164,21 +164,21 @@ struct ComparisonValidator final : IValidator {
     if (type_ == Type::MIN) {
       if (exclusive_) {
         if (v <= s) {
-          return makeError("greater than", schema_, value);
+          return makeError("greater than ", schema_, value);
         }
       } else {
         if (v < s) {
-          return makeError("greater than or equal to", schema_, value);
+          return makeError("greater than or equal to ", schema_, value);
         }
       }
     } else if (type_ == Type::MAX) {
       if (exclusive_) {
         if (v >= s) {
-          return makeError("less than", schema_, value);
+          return makeError("less than ", schema_, value);
         }
       } else {
         if (v > s) {
-          return makeError("less than or equal to", schema_, value);
+          return makeError("less than or equal to ", schema_, value);
         }
       }
     }
@@ -352,7 +352,7 @@ struct RequiredValidator final : IValidator {
     if (value.isObject()) {
       for (const auto& prop : properties_) {
         if (!value.get_ptr(prop)) {
-          return makeError("to have property", prop, value);
+          return makeError("property ", prop, value);
         }
       }
     }
@@ -481,7 +481,7 @@ struct DependencyValidator final : IValidator {
       if (value.count(pair.first)) {
         for (const auto& prop : pair.second) {
           if (!value.count(prop)) {
-            return makeError("property", prop, value);
+            return makeError("property ", prop, value);
           }
         }
       }