From a5ea8f2150825e14aa9da1758fd02cff37035ebb Mon Sep 17 00:00:00 2001
From: murgatroid99 <mlumish@google.com>
Date: Mon, 3 Apr 2017 16:03:58 -0700
Subject: [PATCH] Fix serializer error handling, update ProtoBuf.js dependency

---
 package.json                         | 2 +-
 src/node/src/protobuf_js_6_common.js | 2 +-
 templates/package.json.template      | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/package.json b/package.json
index 440db2ffc8..7f242326d7 100644
--- a/package.json
+++ b/package.json
@@ -34,7 +34,7 @@
     "lodash": "^4.15.0",
     "nan": "^2.0.0",
     "node-pre-gyp": "^0.6.0",
-    "protobufjs": "^6.0.0",
+    "protobufjs": "^6.7.0",
     "cares": "^1.1.5"
   },
   "devDependencies": {
diff --git a/src/node/src/protobuf_js_6_common.js b/src/node/src/protobuf_js_6_common.js
index baa62cce86..7e523731d3 100644
--- a/src/node/src/protobuf_js_6_common.js
+++ b/src/node/src/protobuf_js_6_common.js
@@ -80,7 +80,7 @@ exports.serializeCls = function serializeCls(cls) {
     var message = cls.fromObject(arg);
     var errMsg = cls.verify(message);
     if (errMsg) {
-      throw errMsg;
+      throw Error(errMsg);
     }
     return cls.encode(message).finish();
   };
diff --git a/templates/package.json.template b/templates/package.json.template
index 11fb0fb920..b69fd28d2a 100644
--- a/templates/package.json.template
+++ b/templates/package.json.template
@@ -36,7 +36,7 @@
       "lodash": "^4.15.0",
       "nan": "^2.0.0",
       "node-pre-gyp": "^0.6.0",
-      "protobufjs": "^6.0.0",
+      "protobufjs": "^6.7.0",
       "cares": "^1.1.5"
     },
     "devDependencies": {
-- 
GitLab