From df565786c0bd79860d45af4948ae47ba2368ba6c Mon Sep 17 00:00:00 2001 From: Lourens Schep Date: Tue, 24 May 2022 14:59:44 -0300 Subject: [PATCH] Make sure we throw errors within resolvers --- packages/js/data/src/products/resolvers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/js/data/src/products/resolvers.ts b/packages/js/data/src/products/resolvers.ts index 1acd63fc1ea..72d0b265f78 100644 --- a/packages/js/data/src/products/resolvers.ts +++ b/packages/js/data/src/products/resolvers.ts @@ -25,7 +25,7 @@ export function* getProducts( query: Partial< ProductQuery > ) { return items; } catch ( error ) { yield getProductsError( query, error ); - return error; + throw error; } } @@ -44,5 +44,6 @@ export function* getProductsTotalCount( query: Partial< ProductQuery > ) { return totalCount; } catch ( error ) { yield getProductsTotalCountError( query, error ); + throw error; } }