diff --git a/src/actions/WalletActions.js b/src/actions/WalletActions.js index 063f548e..620d3ace 100644 --- a/src/actions/WalletActions.js +++ b/src/actions/WalletActions.js @@ -86,13 +86,21 @@ export const toggleSidebar = (): WalletAction => ({ export const fetchLocale = (locale: string): ThunkAction => (dispatch: Dispatch): void => { fetch(`./l10n/${locale}.json`) - .then(response => response.json()) + .then(response => { + if (response.ok) { + return response.json(); + } + throw Error(response.statusText); + }) .then(messages => { dispatch({ type: WALLET.SET_LANGUAGE, locale, messages, }); + }) + .catch(error => { + console.log(error); }); };