Better error display in package-client

Addressing: https://github.com/meteor/meteor/issues/3977

HttpHelpers.getUrl sometimes throws an error, and sometimes throws a string. The right
thing to do is to fix getUrl everywhere, but for now, let's get better error handling
in package-client.js
This commit is contained in:
ekatek
2015-03-24 14:37:25 -07:00
parent 63df4b1ce5
commit f4e2e2aab9

View File

@@ -328,7 +328,8 @@ var uploadFile = function (putUrl, filepath) {
bodyStreamLength: size
});
} catch (err) {
buildmessage.error(err.error.toString());
// XXX: getUrl's error handling is terrible and we should fix it there.
buildmessage.error(typeof err === "string" ? err : err.error.toString());
return false;
} finally {
rs.close();