Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions templates/web/src/sdk.ts.twig
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class {{ spec.title | caseUcfirst }} {
}

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

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

return data;
} catch (e) {
if (e instanceof {{spec.title | caseUcfirst}}Exception) {
throw e;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly caused the missing error code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a nested exception caught and then thrown by the parent try/catch.

throw new {{spec.title | caseUcfirst}}Exception((<Error>e).message);
}
}
Expand Down