浏览代码

includes the expected class in the exception, otherwise the error is harder to track down (#3371)

Brent Shaffer 7 年之前
父节点
当前提交
13e627ad69
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      php/src/Google/Protobuf/Internal/GPBUtil.php

+ 1 - 1
php/src/Google/Protobuf/Internal/GPBUtil.php

@@ -194,7 +194,7 @@ class GPBUtil
     public static function checkMessage(&$var, $klass)
     {
         if (!$var instanceof $klass && !is_null($var)) {
-            throw new \Exception("Expect message.");
+            throw new \Exception("Expect $klass.");
         }
     }