Retornar errores en Product
This commit is contained in:
parent
1a66628ec8
commit
b6d022add4
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue