@atproto/xrpc
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -39,3 +39,3 @@ import { z } from 'zod'; | ||
UpstreamFailure = 502, | ||
NotEnoughResouces = 503, | ||
NotEnoughResources = 503, | ||
UpstreamTimeout = 504 | ||
@@ -83,3 +83,4 @@ } | ||
success: boolean; | ||
constructor(status: ResponseType, error?: string | undefined, message?: string); | ||
headers?: Headers; | ||
constructor(status: ResponseType, error?: string | undefined, message?: string, headers?: Headers); | ||
} | ||
@@ -86,0 +87,0 @@ export declare class XRPCInvalidResponseError extends XRPCError { |
{ | ||
"name": "@atproto/xrpc", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -126,3 +126,8 @@ import { Lexicons, ValidationError } from '@atproto/lexicon' | ||
if (res.body && isErrorResponseBody(res.body)) { | ||
throw new XRPCError(resCode, res.body.error, res.body.message) | ||
throw new XRPCError( | ||
resCode, | ||
res.body.error, | ||
res.body.message, | ||
res.headers, | ||
) | ||
} else { | ||
@@ -129,0 +134,0 @@ throw new XRPCError(resCode) |
@@ -44,3 +44,3 @@ import { z } from 'zod' | ||
UpstreamFailure = 502, | ||
NotEnoughResouces = 503, | ||
NotEnoughResources = 503, | ||
UpstreamTimeout = 504, | ||
@@ -61,3 +61,3 @@ } | ||
[ResponseType.UpstreamFailure]: 'UpstreamFailure', | ||
[ResponseType.NotEnoughResouces]: 'NotEnoughResouces', | ||
[ResponseType.NotEnoughResources]: 'NotEnoughResources', | ||
[ResponseType.UpstreamTimeout]: 'UpstreamTimeout', | ||
@@ -78,3 +78,3 @@ } | ||
[ResponseType.UpstreamFailure]: 'Upstream Failure', | ||
[ResponseType.NotEnoughResouces]: 'Not Enough Resouces', | ||
[ResponseType.NotEnoughResources]: 'Not Enough Resources', | ||
[ResponseType.UpstreamTimeout]: 'Upstream Timeout', | ||
@@ -91,2 +91,3 @@ } | ||
success = false | ||
headers?: Headers | ||
@@ -97,2 +98,3 @@ constructor( | ||
message?: string, | ||
headers?: Headers, | ||
) { | ||
@@ -103,2 +105,3 @@ super(message || error || ResponseTypeStrings[status]) | ||
} | ||
this.headers = headers | ||
} | ||
@@ -105,0 +108,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1
2065659
16114