Browse Source

make execption json

Joachim M. Giæver 2 years ago
parent
commit
bee49e1606
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/AbstractPostSerializable.php

+ 3 - 1
src/AbstractPostSerializable.php

@@ -13,7 +13,9 @@ abstract class AbstractPostSerializable implements PostSerializableInterface {
 
             if ($vars[$key] == null && $param->required)
                 throw new \Symfony\Component\HttpClient\Exception\InvalidArgumentException(
-                    sprintf("Missing required argmuent: %s", $key)
+                    json_encode([
+                        $key => sprintf("%s is a required field.", $key)
+                    ])
                 );
         }