Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
const end = Date.now();
const json = await res.json();
const timestamp = json.result;
const roundtrip = start - end;
const thisOffset = timestamp - end + roundtrip / 2;
if (offset === 0) {
// Apply first offset immediately
offset = thisOffset;
}
results.push({ roundtrip, offset: thisOffset });
} catch(e) {
console.log(e);
Sentry.captureException(new Error("error fetching time: " + e.message));
}
await sleep;
}
// calculate the limit for outliers
const roundtrips = results.map(result => result.roundtrip);
const limit = median(roundtrips) + std(roundtrips);
// filter all results which have a roundtrip smaller than the mean+std
const filtered = results.filter(result => result.roundtrip < limit);
var offsets = filtered.map(result => result.offset);
// Now if we have any offsets left, set the main offset to that.
if (offsets.length > 0) {
offset = mean(offsets);
_errorCallback(error) {
Sentry.captureException(error);
console.log('Video error: ', error.message, error.type, error.obj);
}
const downloadResumable = new FileSystem.DownloadResumable(
downloadFromStore.url,
downloadFromStore.fileUri,
downloadFromStore.options,
this._createDownloadProgressHandler(id),
downloadFromStore.resumeData
);
this._downloadResumables[id] = downloadResumable;
const uri = await downloadResumable.resumeAsync();
if (uri) {
this._updateStore(id, DOWNLOADED({ uri }));
}
} catch (e) {
console.log('File download error', e);
Sentry.captureMessage('File download error');
Sentry.captureException(e);
this._updateStore(id, ERROR({ message: 'Error downloading file' }));
} finally {
delete this._downloadResumables[id];
}
}
}
err => Sentry.captureException(err)
);
err => {
Sentry.captureException(err);
Alert.alert('Saving Battle Plan Error', err.message);
}
);
err => {
this.setState({ checking: false });
Sentry.captureException(err);
Alert.alert('Login Error', err.message);
}
);
async register() {
try {
await WebBrowser.openBrowserAsync('https://mymicds.net/register');
} catch (err) {
Sentry.captureException(err);
}
}
err => Sentry.captureException(err)
);
_handleLoadingError = error => {
Sentry.captureException(error);
};
Meteor.call('acrofeverChooseCategory', this.props.gameId, category, (err) => {
if (err) {
Sentry.captureException(new Error("error in acrofeverChooseCategory: " + err.message));
}
});
}