From 07ff5db0b9daad14672305f873ae8253ae7b6214 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Thu, 21 Jun 2018 15:23:14 -0400 Subject: [PATCH] fix: Don't catch api/index errors If we catch these errors and resolve to the error itself, then `await` for that function resolves to the error value rather than throw. Because no api currently handles the associated errors, it is better to be noisy about these errors, by throwing rather than returning the error object. --- app/api/index.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/api/index.js b/app/api/index.js index beb21fac..0d0022b5 100644 --- a/app/api/index.js +++ b/app/api/index.js @@ -5,9 +5,7 @@ export function requestTicker(id) { return axios({ method: 'get', url: BASE_URL - }) - .then(response => response.data) - .catch(error => error) + }).then(response => response.data) } export function requestTickers(ids) { @@ -23,9 +21,7 @@ export function requestBlockHeight() { return axios({ method: 'get', url: BASE_URL - }) - .then(response => response.data) - .catch(error => error) + }).then(response => response.data) } export function requestSuggestedNodes() { @@ -33,7 +29,5 @@ export function requestSuggestedNodes() { return axios({ method: 'get', url: BASE_URL - }) - .then(response => response.data) - .catch(error => error) + }).then(response => response.data) }