Log which method caused Failed to fetch
This commit is contained in:
parent
5e2100000d
commit
36a63e27c1
1 changed files with 7 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
import analytics from 'analytics';
|
||||||
import { NO_AUTH, X_LBRY_AUTH_TOKEN } from 'constants/token';
|
import { NO_AUTH, X_LBRY_AUTH_TOKEN } from 'constants/token';
|
||||||
|
|
||||||
require('proxy-polyfill');
|
require('proxy-polyfill');
|
||||||
|
@ -246,7 +247,12 @@ export function apiCall(method: string, params: ?{}, resolve: Function, reject:
|
||||||
const error = response.error || (response.result && response.result.error);
|
const error = response.error || (response.result && response.result.error);
|
||||||
return error ? reject(error) : resolve(response.result);
|
return error ? reject(error) : resolve(response.result);
|
||||||
})
|
})
|
||||||
.catch(reject);
|
.catch((err) => {
|
||||||
|
if (err.message === 'Failed to fetch') {
|
||||||
|
analytics.error(`\`${method}\`: Failed to fetch`);
|
||||||
|
}
|
||||||
|
return reject(err);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function daemonCallWithResult(
|
function daemonCallWithResult(
|
||||||
|
|
Loading…
Reference in a new issue