https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43516
--- Comment #3 from Martin Renvoize (ashimema) <[email protected]> --- Created attachment 205544 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205544&action=edit Bug 43516: Harden HttpClient against malformed and unreachable API responses Guard against malformed JSON in http-client responses (a truncated body, a proxy error page, a session-expired redirect) instead of letting the parse error surface as the failure. Preserve the HTTP status and Koha error_code on thrown errors so callers can branch on them. Add a per-request config object to both the plain fetch/http-client.js and the Vue-composable vue/fetch/http-client.js: - config.signal cancels the underlying fetch via AbortController. - config.suppressDefaultErrorDialog lets callers that present their own error UI skip the page-level error dialog; the error is still thrown with status/code attached. Split out from bug 41129 (booking workflows), where this was introduced across three patches, into its own bug as generic frontend infrastructure. Test plan: 1. Run: yarn cypress run --component --browser electron --spec 't/cypress/component/HttpClient_spec.ts,t/cypress/component/VueHttpClient_spec.ts' 2. Verify all specs pass. Co-authored-by: Paul Derscheid <[email protected]> Co-authored-by: Martin Renvoize <[email protected]> Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/> Assisted-by: Opus 4.8 (Anthropic) Assisted-by: GPT 5.6 (OpenAI) Signed-off-by: Martin Renvoize <[email protected]> Signed-off-by: Jacob O'Mara <[email protected]> Signed-off-by: Paul Derscheid <[email protected]> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. _______________________________________________ Koha-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected] website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
