a collection of lightweight TypeScript packages for AT Protocol, the protocol powering Bluesky
atproto bluesky typescript npm
101
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(util-fetch): expose response in FailedResponseError

Mary 71d97445 35869ba8

+12 -10
+5
.changeset/spicy-parts-talk.md
··· 1 + --- 2 + '@atcute/util-fetch': patch 3 + --- 4 + 5 + expose response in FailedResponseError
+6 -5
packages/misc/util-fetch/lib/errors.ts
··· 5 5 export class FailedResponseError extends FetchResponseError { 6 6 override name = 'FailedResponseError'; 7 7 8 - constructor( 9 - public status: number, 10 - reason: string, 11 - ) { 12 - super(reason); 8 + constructor(public response: Response) { 9 + super(`got http ${response.status}`); 10 + } 11 + 12 + get status(): number { 13 + return this.response.status; 13 14 } 14 15 } 15 16
+1 -5
packages/misc/util-fetch/lib/transformers.ts
··· 18 18 return response; 19 19 } 20 20 21 - if (response.body) { 22 - await response.body.cancel(); 23 - } 24 - 25 - throw new err.FailedResponseError(response.status, `got http ${response.status}`); 21 + throw new err.FailedResponseError(response); 26 22 }; 27 23 28 24 export const readResponseAsText =