mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-13 17:22:49 +00:00
catch 503 error
This commit is contained in:
@@ -60,6 +60,7 @@ const ArchivePage = createClass({
|
|||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`LoadPage error: ${error}`);
|
console.log(`LoadPage error: ${error}`);
|
||||||
|
this.setState({ error: {error} });
|
||||||
this.updateStateWithBrews([], 1, 1);
|
this.updateStateWithBrews([], 1, 1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -67,8 +68,7 @@ const ArchivePage = createClass({
|
|||||||
updateUrl : function() {
|
updateUrl : function() {
|
||||||
const url = new URL(window.location.href);
|
const url = new URL(window.location.href);
|
||||||
const urlParams = new URLSearchParams(url.search);
|
const urlParams = new URLSearchParams(url.search);
|
||||||
|
|
||||||
// Set the title and page parameters
|
|
||||||
urlParams.set('title', this.state.title);
|
urlParams.set('title', this.state.title);
|
||||||
urlParams.set('page', this.state.page);
|
urlParams.set('page', this.state.page);
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ const ArchivePage = createClass({
|
|||||||
|
|
||||||
if(title === '') {return (<div className='foundBrews noBrews'><h3>Whenever you want, just start typing...</h3></div>);}
|
if(title === '') {return (<div className='foundBrews noBrews'><h3>Whenever you want, just start typing...</h3></div>);}
|
||||||
|
|
||||||
if(error !== null) {
|
if(error === 'Error: Service Unavailable') {
|
||||||
return (
|
return (
|
||||||
<div className='foundBrews noBrews'>
|
<div className='foundBrews noBrews'>
|
||||||
<div><h3>I'm sorry, your request didn't work</h3>
|
<div><h3>I'm sorry, your request didn't work</h3>
|
||||||
@@ -116,7 +116,7 @@ const ArchivePage = createClass({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!brewCollection || brewCollection.length === 0) {
|
if(!brewCollection || brewCollection.length === 0 || error === 'Error: Not found') {
|
||||||
return (
|
return (
|
||||||
<div className='foundBrews noBrews'>
|
<div className='foundBrews noBrews'>
|
||||||
<h3>We haven't found brews meeting your request.</h3>
|
<h3>We haven't found brews meeting your request.</h3>
|
||||||
|
|||||||
Reference in New Issue
Block a user