mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-26 21:15:15 +00:00
Prevent logging errors twice
This commit is contained in:
parent
4f872fbf73
commit
9320d630d4
|
@ -29,7 +29,7 @@ export function init(store) {
|
|||
api.interceptors.response.use(
|
||||
(response) => response,
|
||||
(err) => {
|
||||
console.log(err);
|
||||
// console.log(err);
|
||||
if (err.response && err.response.status === 401) {
|
||||
console.log('Dispatching refresh_token...');
|
||||
return userService
|
||||
|
@ -58,9 +58,10 @@ export function init(store) {
|
|||
// maybe redirect to /login if needed !
|
||||
}
|
||||
if ((err.response && err.response.status === 500) || err.message === 'Network Error') {
|
||||
console.log('Bot seems to be offline...');
|
||||
console.log('Bot not running...');
|
||||
store.dispatch('setIsBotOnline', false);
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
reject(err);
|
||||
});
|
||||
|
|
|
@ -424,7 +424,7 @@ export default {
|
|||
return Promise.resolve(result.data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
// console.error(error);
|
||||
return Promise.reject(error);
|
||||
});
|
||||
},
|
||||
|
@ -440,11 +440,13 @@ export default {
|
|||
.then((result) => commit('updateProfit', result.data))
|
||||
.catch(console.error);
|
||||
},
|
||||
getBalance({ commit }) {
|
||||
return api
|
||||
.get('/balance')
|
||||
.then((result) => commit('updateBalance', result.data))
|
||||
.catch(console.error);
|
||||
async getBalance({ commit }) {
|
||||
try {
|
||||
const result = await api.get('/balance');
|
||||
return commit('updateBalance', result.data);
|
||||
} catch (error) {
|
||||
return console.error(error);
|
||||
}
|
||||
},
|
||||
getDaily({ commit }, payload: DailyPayload = {}) {
|
||||
const { timescale = 20 } = payload;
|
||||
|
|
Loading…
Reference in New Issue
Block a user