@upstash/qstash
Advanced tools
Comparing version 0.3.7-canary.0 to 0.4.0-canary.0
@@ -10,1 +10,6 @@ /** | ||
} | ||
export class QstashRatelimitError extends QstashError { | ||
constructor(args) { | ||
super(`You have been ratelimited. ${JSON.stringify(args)} `); | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import { QstashError } from "./error.js"; | ||
import { QstashError, QstashRatelimitError } from "./error.js"; | ||
export class HttpClient { | ||
@@ -76,2 +76,9 @@ constructor(config) { | ||
} | ||
if (res.status === 429) { | ||
throw new QstashRatelimitError({ | ||
limit: res.headers.get("Burst-RateLimit-Limit"), | ||
remaining: res.headers.get("Burst-RateLimit-Remaining"), | ||
reset: res.headers.get("Burst-RateLimit-Reset"), | ||
}); | ||
} | ||
if (res.status < 200 || res.status >= 300) { | ||
@@ -78,0 +85,0 @@ throw new QstashError(await res.text() ?? res.statusText); |
@@ -6,3 +6,3 @@ { | ||
"name": "@upstash/qstash", | ||
"version": "v0.3.7-canary.0", | ||
"version": "v0.4.0-canary.0", | ||
"description": "Official Deno/Typescript client for QStash", | ||
@@ -9,0 +9,0 @@ "repository": { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.QstashError = void 0; | ||
exports.QstashRatelimitError = exports.QstashError = void 0; | ||
/** | ||
@@ -14,1 +14,7 @@ * Result of 500 Internal Server Error | ||
exports.QstashError = QstashError; | ||
class QstashRatelimitError extends QstashError { | ||
constructor(args) { | ||
super(`You have been ratelimited. ${JSON.stringify(args)} `); | ||
} | ||
} | ||
exports.QstashRatelimitError = QstashRatelimitError; |
@@ -79,2 +79,9 @@ "use strict"; | ||
} | ||
if (res.status === 429) { | ||
throw new error_js_1.QstashRatelimitError({ | ||
limit: res.headers.get("Burst-RateLimit-Limit"), | ||
remaining: res.headers.get("Burst-RateLimit-Remaining"), | ||
reset: res.headers.get("Burst-RateLimit-Reset"), | ||
}); | ||
} | ||
if (res.status < 200 || res.status >= 300) { | ||
@@ -81,0 +88,0 @@ throw new error_js_1.QstashError(await res.text() ?? res.statusText); |
@@ -7,1 +7,4 @@ /** | ||
} | ||
export declare class QstashRatelimitError extends QstashError { | ||
constructor(args: unknown); | ||
} |
@@ -1,2 +0,2 @@ | ||
import { crypto } from "../deps/deno.land/std@0.186.0/crypto/mod.js"; | ||
import { crypto } from "../deps/deno.land/std@0.192.0/crypto/mod.js"; | ||
export declare type SubtleCrypto = typeof crypto.subtle; | ||
@@ -3,0 +3,0 @@ /** |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
674080
11795