We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a82fd9f commit aac32b4Copy full SHA for aac32b4
1 file changed
src/components/ymd-timestamp-header.jsx
@@ -212,7 +212,14 @@ export default class YmdTimestampHeader extends React.Component {
212
213
return fetch(requestUrl)
214
.then(jsonResponse)
215
- .then(data => data['items'])
+ .then(data => {
216
+ const items = data.items || [];
217
+ const allErrors = items.length > 0 && items.every(item => item[1] >= 400);
218
+ if (allErrors) {
219
+ throw new Error(`Year ${year1} month ${month1} has no status=200 captures and cannot be used for comparison.`);
220
+ }
221
+ return items;
222
+ })
223
.then(data => data.map(item => [year1 + month1 + String(item[0]).padStart(8, '0'), item[2]]))
224
.catch(error => { this._errorHandled(error.message); });
225
};
0 commit comments