From 4567ffea41fcfe126b07ef78a7073b7f456ee012 Mon Sep 17 00:00:00 2001 From: Domagoj Kriskovic Date: Mon, 30 Mar 2026 17:22:54 +0200 Subject: [PATCH] [web] error handling for BibTeX entry addition using \cite GitOrigin-RevId: efdf39a959fda7d2f970860051e1fabd72474ab1 --- services/web/frontend/extracted-translations.json | 2 ++ services/web/frontend/js/infrastructure/fetch-json.ts | 7 +++++++ services/web/locales/en.json | 2 ++ 3 files changed, 11 insertions(+) diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 6325078a57..a0be14ed4c 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -371,6 +371,8 @@ "copy_response": "", "copying": "", "cost_summary": "", + "could_not_save_reference_to_bib_file": "", + "could_not_save_reference_to_bib_file_forbidden": "", "country": "", "country_flag": "", "coupon_code": "", diff --git a/services/web/frontend/js/infrastructure/fetch-json.ts b/services/web/frontend/js/infrastructure/fetch-json.ts index 1d3af35451..12600763cd 100644 --- a/services/web/frontend/js/infrastructure/fetch-json.ts +++ b/services/web/frontend/js/infrastructure/fetch-json.ts @@ -251,3 +251,10 @@ export function isRateLimited(error?: Error | FetchError | any) { } return false } + +export function isForbidden(error?: Error | FetchError | any) { + if (error && error instanceof FetchError) { + return error.response?.status === 403 + } + return false +} diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 2cc51684fe..91608c7b9e 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -502,6 +502,8 @@ "could_not_connect_to_collaboration_server": "Could not connect to collaboration server", "could_not_connect_to_websocket_server": "Could not connect to WebSocket server", "could_not_load_translations": "Could not load translations", + "could_not_save_reference_to_bib_file": "The reference could not be saved to a .bib file.", + "could_not_save_reference_to_bib_file_forbidden": "The reference could not be saved to a .bib file. Ask a collaborator with edit access to add it.", "country": "Country", "country_flag": "__country__ country flag", "coupon_code": "Coupon code",