diff --git a/frontend/javascripts/admin/api/token.ts b/frontend/javascripts/admin/api/token.ts index 3dfdd5e450..9adae19880 100644 --- a/frontend/javascripts/admin/api/token.ts +++ b/frontend/javascripts/admin/api/token.ts @@ -38,7 +38,7 @@ export async function doWithToken( fn: (token: string) => Promise, tries: number = 1, useURLTokenIfAvailable: boolean = true, -): Promise { +): Promise { let token = useURLTokenIfAvailable && shouldUseURLToken ? getSharingTokenFromUrlParameters() : null; diff --git a/frontend/javascripts/libs/request.ts b/frontend/javascripts/libs/request.ts index aff50101f9..25bf31657e 100644 --- a/frontend/javascripts/libs/request.ts +++ b/frontend/javascripts/libs/request.ts @@ -312,7 +312,7 @@ class Request { key: json.status.toString(), })); if (showErrorToast) { - Toast.messages(messages); // Toast.error already logs the error + Toast.messages(messages); // Note: Toast.error internally logs to console } else { console.error(messages); } @@ -324,9 +324,9 @@ class Request { return Promise.reject({ ...json, url: requestedUrl }); } catch (_jsonError) { if (showErrorToast) { - Toast.error(text); // Toast.error already logs the error + Toast.error(text); // Note: Toast.error internally logs to console } else { - console.error(text); + console.error(`Request failed for ${requestedUrl}:`, text); } /* eslint-disable-next-line prefer-promise-reject-errors */