1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

don't NPE on 50x's - as per BOTS-170

This commit is contained in:
Matthew Hodgson
2016-02-22 10:34:43 +00:00
parent 2150bdc444
commit 363b08c4d8

View File

@@ -501,6 +501,7 @@ var requestCallback = function(defer, userDefinedCallback, onlyData) {
* @prop {integer} httpStatus The numeric HTTP status code given * @prop {integer} httpStatus The numeric HTTP status code given
*/ */
module.exports.MatrixError = function MatrixError(errorJson) { module.exports.MatrixError = function MatrixError(errorJson) {
errorJson = errorJson || {};
this.errcode = errorJson.errcode; this.errcode = errorJson.errcode;
this.name = errorJson.errcode || "Unknown error code"; this.name = errorJson.errcode || "Unknown error code";
this.message = errorJson.error || "Unknown message"; this.message = errorJson.error || "Unknown message";