Skip to content

Commit a89d34f

Browse files
committed
fix: appwrite exception already read
1 parent 9e89b0b commit a89d34f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

templates/react-native/src/client.ts.twig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,9 @@ class Client {
414414

415415
try {
416416
let data = null;
417+
let text: string = '';
418+
417419
const response = await fetch(url.toString(), options);
418-
const text = await response.text()
419420

420421
const warnings = response.headers.get('x-{{ spec.title | lower }}-warning');
421422
if (warnings) {
@@ -424,7 +425,9 @@ class Client {
424425

425426
if (response.headers.get('content-type')?.includes('application/json')) {
426427
data = await response.json();
428+
text = JSON.stringify(data);
427429
} else {
430+
text = await response.text();
428431
data = {
429432
message: text
430433
};

0 commit comments

Comments
 (0)