Skip to content

Commit 065fdf0

Browse files
committed
chore: regenerate sdk
1 parent 3bd563d commit 065fdf0

File tree

9 files changed

+88
-85
lines changed

9 files changed

+88
-85
lines changed

src/client.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,7 @@ class Client {
704704
const { uri, options } = this.prepareRequest(method, url, headers, params);
705705

706706
let data: any = null;
707+
let text: string = '';
707708

708709
const response = await fetch(uri, options);
709710

@@ -714,16 +715,18 @@ class Client {
714715

715716
if (response.headers.get('content-type')?.includes('application/json')) {
716717
data = await response.json();
718+
text = JSON.stringify(data);
717719
} else if (responseType === 'arrayBuffer') {
718720
data = await response.arrayBuffer();
719721
} else {
722+
text = await response.text();
720723
data = {
721-
message: await response.text()
724+
message: text
722725
};
723726
}
724727

725728
if (400 <= response.status) {
726-
throw new AppwriteException(data?.message, response.status, data?.type, data);
729+
throw new AppwriteException(data?.message, response.status, data?.type, text);
727730
}
728731

729732
const cookieFallback = response.headers.get('X-Fallback-Cookies');

0 commit comments

Comments
 (0)