diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-10-25 18:02:15 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-10-25 18:02:15 -0500 |
| commit | 600b0b5d484c4c6959f2d527a2c77e3faa1f28ef (patch) | |
| tree | bc4e0dbbcaa090fa0610793c78658cf4052a56e6 | |
| parent | 8bf64a6319040a7e4002a4d27ce4f21f17d7da2f (diff) | |
| download | slskd-600b0b5d484c4c6959f2d527a2c77e3faa1f28ef.tar.gz | |
trap and log errors
| -rw-r--r-- | src/web/src/components/Transfers/TransferGroup.jsx | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/web/src/components/Transfers/TransferGroup.jsx b/src/web/src/components/Transfers/TransferGroup.jsx index ea4fba04..f150459a 100644 --- a/src/web/src/components/Transfers/TransferGroup.jsx +++ b/src/web/src/components/Transfers/TransferGroup.jsx @@ -65,21 +65,29 @@ class TransferGroup extends Component { }; cancelAll = async (direction, username, selected) => { - await Promise.all( - selected.map((file) => - transfers.cancel({ direction, id: file.id, username }), - ), - ); + try { + await Promise.all( + selected.map((file) => + transfers.cancel({ direction, id: file.id, username }), + ), + ); + } catch (error) { + console.error(error); + } }; removeAll = async (direction, username, selected) => { - await Promise.all( - selected.map((file) => - transfers - .cancel({ direction, id: file.id, remove: true, username }) - .then(() => this.removeFileSelection(file)), - ), - ); + try { + await Promise.all( + selected.map((file) => + transfers + .cancel({ direction, id: file.id, remove: true, username }) + .then(() => this.removeFileSelection(file)), + ), + ); + } catch (error) { + console.error(error); + } }; handleRetry = async (file) => { |
