Retornar errores en Product

This commit is contained in:
Cat /dev/Nulo 2021-11-01 17:47:07 -03:00
parent 1a66628ec8
commit b6d022add4

View file

@ -73,7 +73,10 @@ export async function getProductos(
}, },
} }
); );
const json: ProductosResponse = await res.json(); const json = await res.json();
console.debug(json); console.debug(json);
if (json.Message) {
throw new Error(`Tango: ${json.Message}`);
}
return json; return json;
} }