Skip to content

Commit

Permalink
fix: saneurl instability
Browse files Browse the repository at this point in the history
  • Loading branch information
xgui3783 committed Feb 17, 2025
1 parent 230d5c2 commit 048b93f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions docs/releases/v2.14.16.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@
"tslib": "^2.3.0",
"zone.js": "^0.13.3"
}
}
}
17 changes: 15 additions & 2 deletions src/util/priority.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ type Queue = {
next: HttpHandler
}

class SxplrHttpError extends Error {
constructor(message: string, public status: number){
super(message)
}
}

@Injectable({
providedIn: 'root'
})
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 048b93f

Please sign in to comment.