Skip to content

Commit a3af7d7

Browse files
Merge pull request #262 from dpakach/fix-error-response
Add response to the WebDAVClientError type
2 parents 0759fce + 588b738 commit a3af7d7

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

source/response.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export function handleResponseCode(context: WebDAVClientContext, response: Respo
1515
`Invalid response: ${status} ${response.statusText}`
1616
) as WebDAVClientError;
1717
err.status = status;
18+
err.response = response;
1819
throw err;
1920
}
2021
return response;

source/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ export interface WebDAVClientContext {
251251

252252
export interface WebDAVClientError extends Error {
253253
status?: number;
254+
response?: Response;
254255
}
255256

256257
export interface WebDAVClientOptions {

0 commit comments

Comments
 (0)