TUS: Skip logging "423/409 concurrent upload" errors.

This commit is contained in:
infinite-persistence 2021-11-23 09:30:17 +08:00
parent a3111003a2
commit 605a8f371d
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -16,9 +16,11 @@ class ModalError extends React.PureComponent<Props> {
// https://github.com/lbryio/lbry-sdk/issues/1118 // https://github.com/lbryio/lbry-sdk/issues/1118
// The sdk logs failed downloads, they happen so often that it's mostly noise in the desktop logs // The sdk logs failed downloads, they happen so often that it's mostly noise in the desktop logs
const errorMessage = typeof error === 'string' ? error : error.message; const errorMessage = typeof error === 'string' ? error : error.message;
const failedToDownloadError = errorMessage.startsWith('Failed to download'); const skipLog =
errorMessage.startsWith('Failed to download') ||
errorMessage.endsWith('Uploading the same file from multiple tabs or windows is not allowed.');
if (process.env.NODE_ENV === 'production' && !failedToDownloadError) { if (process.env.NODE_ENV === 'production' && !skipLog) {
Lbryio.call('event', 'desktop_error', { error_message: JSON.stringify(error) }); Lbryio.call('event', 'desktop_error', { error_message: JSON.stringify(error) });
} }
} }