diff --git a/codemeta.json b/codemeta.json index b951a6923..c52d81111 100644 --- a/codemeta.json +++ b/codemeta.json @@ -57,7 +57,7 @@ ], "codeRepository": "git+https://github.com/fzj-inm1-bda/siibra-explorer.git", "dateCreated": "2024-08-28", - "dateModified": "2025-01-13", + "dateModified": "2025-01-17", "datePublished": "2019-04-26", "description": "`siibra-explorer` is a browser based 3D viewer for exploring brain atlases that cover different spatial resolutions and modalities. It is built around an interactive 3D view of the brain displaying a unique selection of detailed templates and parcellation maps for the human, macaque, rat or mouse brain, including BigBrain as a microscopic resolution human brain model at its full resolution of 20 micrometers. ", "license": "https://spdx.org/licenses/Apache-2.0", @@ -66,7 +66,7 @@ "python 3", "typescript" ], - "schema:releaseNotes": "# v2.14.16\n\n## Feature\n\n- allow position of substrate to be customized (#1479)\n- parse template `meta.json` endpoint, and use RBG color map when prompted\n- (experimental): added support to fetch `.dzi` transform\n- (experimental): added support for zarr(2) as data feature\n\n## Behind the scene\n\n- added prepare release to package.json script\n", + "schema:releaseNotes": "# v2.14.16\n\n## Feature\n\n- allow position of substrate to be customized (#1479)\n- parse template `meta.json` endpoint, and use RBG color map when prompted\n- (experimental): added support to fetch `.dzi` transform\n- (experimental): added support for zarr(2) as data feature\n\n## Bugfix\n\n- fix issue where repeated request for saneURL yield unstable behavior\n\n## Behind the scene\n\n- added prepare release to package.json script\n", "runtimePlatform": "docker", "version": "2.14.16", "contIntegration": "https://github.com/FZJ-INM1-BDA/siibra-explorer/actions", diff --git a/docs/releases/v2.14.16.md b/docs/releases/v2.14.16.md index 1f3f3b312..010bc1f43 100644 --- a/docs/releases/v2.14.16.md +++ b/docs/releases/v2.14.16.md @@ -7,6 +7,10 @@ - (experimental): added support to fetch `.dzi` transform - (experimental): added support for zarr(2) as data feature +## Bugfix + +- fix issue where repeated request for saneURL yield unstable behavior + ## Behind the scene - added prepare release to package.json script diff --git a/package.json b/package.json index 229a32d34..140a87faa 100644 --- a/package.json +++ b/package.json @@ -63,4 +63,4 @@ "tslib": "^2.3.0", "zone.js": "^0.13.3" } -} +} \ No newline at end of file diff --git a/src/util/priority.ts b/src/util/priority.ts index 03e99d3b5..6705bdc53 100644 --- a/src/util/priority.ts +++ b/src/util/priority.ts @@ -22,6 +22,12 @@ type Queue = { next: HttpHandler } +class SxplrHttpError extends Error { + constructor(message: string, public status: number){ + super(message) + } +} + @Injectable({ providedIn: 'root' }) @@ -109,8 +115,8 @@ export class PriorityHttpInterceptor implements HttpInterceptor{ }) } if (val instanceof HttpErrorResponse) { - const error = new Error( - PriorityHttpInterceptor.ErrorToString(val) + const error = new SxplrHttpError( + PriorityHttpInterceptor.ErrorToString(val), val.status ) this.archive.set(urlWithParams, error) this.error$.next({ @@ -151,6 +157,13 @@ export class PriorityHttpInterceptor implements HttpInterceptor{ const { urlWithParams } = req const archive = this.archive.get(urlWithParams) if (archive) { + if (archive instanceof SxplrHttpError) { + return throwError({ + urlWithParams, + error: archive, + status: archive.status + }) + } if (archive instanceof Error) { return throwError({ urlWithParams,