Skip to content
This repository was archived by the owner on Dec 1, 2018. It is now read-only.

Commit e85acac

Browse files
committed
Throw error when receives 404
1 parent 802e5d7 commit e85acac

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pokemongo-game-master",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Collection of the decoded GAME_MASTER-protobuf files",
55
"main": "src/index.js",
66
"scripts": {

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ const getVersion = (version, format) => {
2424
}
2525
// Get Date
2626
request.get(`${FETCH_URL}/${version}/GAME_MASTER.${format}`, (error, response, body) => {
27-
if (error) reject(error);
27+
if(response.body === '404: Not Found\n') return reject(new Error('Given version could not be found.'));
28+
if (error) return reject(error);
2829

2930
// Parse output, if JSON is selected
3031
if (format === 'json') {

0 commit comments

Comments
 (0)