Move error definitions to errors.js (#898)
This commit is contained in:
@@ -4,6 +4,7 @@ const prettyBytes = require('prettier-bytes')
|
||||
const TorrentSummary = require('../lib/torrent-summary')
|
||||
const TorrentPlayer = require('../lib/torrent-player')
|
||||
const {dispatcher} = require('../lib/dispatcher')
|
||||
const {InvalidTorrentError} = require('../lib/errors')
|
||||
|
||||
module.exports = class TorrentList extends React.Component {
|
||||
render () {
|
||||
@@ -58,7 +59,7 @@ module.exports = class TorrentList extends React.Component {
|
||||
if (torrentSummary.playStatus) classes.push(torrentSummary.playStatus)
|
||||
if (isSelected) classes.push('selected')
|
||||
if (!infoHash) classes.push('disabled')
|
||||
if (!torrentSummary.torrentKey) throw new Error('Missing torrentKey')
|
||||
if (!torrentSummary.torrentKey) throw new InvalidTorrentError('Missing torrentKey')
|
||||
return (
|
||||
<div
|
||||
key={torrentSummary.torrentKey}
|
||||
|
||||
Reference in New Issue
Block a user