From 6d5bcdf9fc2293997cba41bd17d62298f3a40f29 Mon Sep 17 00:00:00 2001
From: Xiao Gui <xgui3783@gmail.com>
Date: Thu, 30 Mar 2023 10:02:44 +0200
Subject: [PATCH] fix: archived error not properly emitted (http priority
 interceptor)

fix: PLI short link
---
 deploy/bkwdCompat/urlState.js | 2 +-
 src/util/priority.ts          | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/deploy/bkwdCompat/urlState.js b/deploy/bkwdCompat/urlState.js
index 52b245bcc..14b765d34 100644
--- a/deploy/bkwdCompat/urlState.js
+++ b/deploy/bkwdCompat/urlState.js
@@ -120,7 +120,7 @@ const WARNING_STRINGS = {
   REGION_SELECT_ERROR: 'Region selected cannot be processed properly.',
   TEMPLATE_ERROR: 'Template not found.',
 }
-const pliPreviewUrl = `/a:juelich:iav:atlas:v1.0.0:1/t:minds:core:referencespace:v1.0.0:a1655b99-82f1-420f-a3c2-fe80fd4c8588/p:juelich:iav:atlas:v1.0.0:4/@:0.0.0.-W000.._eCwg.2-FUe3._-s_W.2_evlu..7LIy..1qI1a.D31U~.i-Os~..HRE/f:siibra:features:voi:19c437087299dd62e7c507200f69aea6`
+const pliPreviewUrl = `/a:juelich:iav:atlas:v1.0.0:1/t:minds:core:referencespace:v1.0.0:a1655b99-82f1-420f-a3c2-fe80fd4c8588/p:juelich:iav:atlas:v1.0.0:4/@:0.2-4Fk_.-KlpS.0.._eCwg.2-FUe3._-s_W.2_evlu..7LIy..1WNl8.6Tjd~.bTYu~..Zdk/f:b08a7dbc-7c75-4ce7-905b-690b2b1e8957--d3ca8fe622051466a5cde547a11111ca`
 module.exports = (query, _warningCb) => {
 
   const HOST_PATHNAME = process.env.HOST_PATHNAME || ''
diff --git a/src/util/priority.ts b/src/util/priority.ts
index 5ad57d734..2dcd8a28b 100644
--- a/src/util/priority.ts
+++ b/src/util/priority.ts
@@ -32,7 +32,7 @@ export class PriorityHttpInterceptor implements HttpInterceptor{
   private priorityQueue: Queue[] = []
 
   private currentJob: Set<string> = new Set()
-  private archive: Map<string, (HttpResponse<unknown>|Error)> = new Map()
+  private archive: Map<string, (HttpErrorResponse|HttpResponse<unknown>|Error)> = new Map()
   private queue$: Subject<Queue> = new Subject()
   private result$: Subject<Result<unknown>> = new Subject()
   private error$: Subject<ErrorResult> = new Subject()
@@ -138,6 +138,9 @@ export class PriorityHttpInterceptor implements HttpInterceptor{
       if (archive instanceof Error) {
         return throwError(archive)
       }
+      if (archive instanceof HttpErrorResponse) {
+        return throwError(archive)
+      }
       if (archive instanceof HttpResponse) {
         return of( archive.clone() )
       }
-- 
GitLab