From 9cdca6acdaad3af7068d542c983350f37a6572d4 Mon Sep 17 00:00:00 2001 From: jomo Date: Sun, 20 Sep 2015 21:28:43 +0200 Subject: [PATCH] don't throw strings --- lib/networking.js | 2 +- test/test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/networking.js b/lib/networking.js index 3c427c7..80f43da 100644 --- a/lib/networking.js +++ b/lib/networking.js @@ -96,7 +96,7 @@ exp.get_from_options = function(rid, url, options, callback) { case 429: // this shouldn't usually happen, but occasionally does // forcing error so it's not cached - error = error || "TooManyRequestsException"; + error = error || new Error("TooManyRequestsException"); break; default: if (!error) { diff --git a/test/test.js b/test/test.js index 2f56c29..a77879f 100644 --- a/test/test.js +++ b/test/test.js @@ -1013,7 +1013,7 @@ describe("Crafatar", function() { it("uuid should be rate limited", function(done) { networking.get_profile(rid, id, function() { networking.get_profile(rid, id, function(err, profile) { - assert.strictEqual(err, "TooManyRequestsException"); + assert.strictEqual(err.message, "TooManyRequestsException"); assert.strictEqual(profile.error, "TooManyRequestsException"); done(); });