Skip to content

Commit

Permalink
fix #77: show error regarding v2 api if api endpoint is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
abhijithvijayan committed Mar 10, 2020
1 parent ae372d8 commit 1a3c2ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ async function shortenUrl({
message: `Error: ${err.response.data.error}`,
};
}

// ToDo: remove in the next major update
if (err.response.status === 404) {
return {
error: true,
message: 'Error: This extension now uses API v2, please update your kutt.it instance.',
};
}
}

if (err.code === 'ECONNABORTED') {
Expand Down

0 comments on commit 1a3c2ab

Please sign in to comment.