don't throw strings

This commit is contained in:
jomo 2015-09-20 21:28:43 +02:00
parent 26f6b089ef
commit 9cdca6acda
2 changed files with 2 additions and 2 deletions

View File

@ -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) {

View File

@ -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();
});