mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-03 14:52:38 +00:00
fix error managing
This commit is contained in:
@@ -65,10 +65,7 @@ const VaultPage = (props)=>{
|
|||||||
`/api/vault?title=${title}&author=${author}&v3=${v3}&legacy=${legacy}&count=${count}&page=${page}`
|
`/api/vault?title=${title}&author=${author}&v3=${v3}&legacy=${legacy}&count=${count}&page=${page}`
|
||||||
).catch((error)=>{
|
).catch((error)=>{
|
||||||
console.log('error at loadPage: ', error);
|
console.log('error at loadPage: ', error);
|
||||||
setError(`${error.response
|
setError(error);
|
||||||
? error.response.status
|
|
||||||
: error.message}`
|
|
||||||
);
|
|
||||||
updateStateWithBrews([], 1);
|
updateStateWithBrews([], 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -83,10 +80,7 @@ const VaultPage = (props)=>{
|
|||||||
`/api/vault/total?title=${title}&author=${author}&v3=${v3}&legacy=${legacy}`
|
`/api/vault/total?title=${title}&author=${author}&v3=${v3}&legacy=${legacy}`
|
||||||
).catch((error)=>{
|
).catch((error)=>{
|
||||||
console.log('error at loadTotal: ', error);
|
console.log('error at loadTotal: ', error);
|
||||||
setError(`${error.response
|
setError(error);
|
||||||
? error.response.status
|
|
||||||
: error.message}`
|
|
||||||
);
|
|
||||||
updateStateWithBrews([], 1);
|
updateStateWithBrews([], 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -334,9 +328,8 @@ const VaultPage = (props)=>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(error) {
|
if(error) {
|
||||||
const errorText = ErrorIndex({ brew })[brew.HBErrorCode.toString()] || '';
|
const errorText = ErrorIndex()[error.HBErrorCode.toString()] || '';
|
||||||
console.log('render Error: ', error);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='foundBrews noBrews'>
|
<div className='foundBrews noBrews'>
|
||||||
<h3>Error: {errorText}</h3>
|
<h3>Error: {errorText}</h3>
|
||||||
|
|||||||
Reference in New Issue
Block a user