From b6d022add40a19f1490540da0bb60e2a2c4d55c1 Mon Sep 17 00:00:00 2001 From: Nulo Date: Mon, 1 Nov 2021 17:47:07 -0300 Subject: [PATCH] Retornar errores en Product --- product.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/product.ts b/product.ts index 56d7c34..2fd2a7f 100644 --- a/product.ts +++ b/product.ts @@ -73,7 +73,10 @@ export async function getProductos( }, } ); - const json: ProductosResponse = await res.json(); + const json = await res.json(); console.debug(json); + if (json.Message) { + throw new Error(`Tango: ${json.Message}`); + } return json; }