From b58ccce95ef53bc4114610b1f47272b26f8a5263 Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Wed, 9 Aug 2023 11:48:44 -0400 Subject: [PATCH 1/2] error handling- ensures policyLookupSuccessful is set to false for failed policy lookups --- src/store/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/store/index.js b/src/store/index.js index 5b0f9f15..d91b152e 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -345,6 +345,9 @@ export const useMainStore = defineStore({ const responsePolicy = r.data.policies?.[0]; policy.policyLookupSuccessful = !!responsePolicy; return r; + }, (r) => { + policy.policyLookupSuccessful = false; + return r; }); return response; } catch (responseError) { From 8def45c7daf9ac6be550326b70db23d58fcb515e Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Thu, 10 Aug 2023 11:16:39 -0400 Subject: [PATCH 2/2] add .catch() to method --- src/store/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 7d954770..62daba35 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -345,9 +345,9 @@ export const useMainStore = defineStore({ const responsePolicy = r.data.policies?.[0]; policy.policyLookupSuccessful = !!responsePolicy; return r; - }, (r) => { + }).catch((error) => { policy.policyLookupSuccessful = false; - return r; + return error; }); return response; } catch (responseError) {