Skip to content

Commit ac40262

Browse files
Merge pull request #249 from appwrite/fix-exception-code
fix(web): exception code
2 parents 9fd37ad + 8e55d12 commit ac40262

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

templates/web/src/sdk.ts.twig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class {{ spec.title | caseUcfirst }} {
205205
}
206206

207207
/**
208-
* Subscribes to Appwrite events and passes you the payload in realtime.
208+
* Subscribes to {{spec.title | caseUcfirst}} events and passes you the payload in realtime.
209209
*
210210
* @param {string|string[]} channels
211211
* Channel to subscribe - pass a single channel as a string or multiple with an array of strings.
@@ -319,12 +319,15 @@ class {{ spec.title | caseUcfirst }} {
319319
const cookieFallback = response.headers.get('X-Fallback-Cookies');
320320

321321
if (typeof window !== 'undefined' && window.localStorage && cookieFallback) {
322-
window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.');
322+
window.console.warn('{{spec.title | caseUcfirst}} is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.');
323323
window.localStorage.setItem('cookieFallback', cookieFallback);
324324
}
325325

326326
return data;
327327
} catch (e) {
328+
if (e instanceof {{spec.title | caseUcfirst}}Exception) {
329+
throw e;
330+
}
328331
throw new {{spec.title | caseUcfirst}}Exception((<Error>e).message);
329332
}
330333
}

0 commit comments

Comments
 (0)