44 lines
1.1 KiB
JavaScript
44 lines
1.1 KiB
JavaScript
import ExtendableError from 'es6-error'
|
|
/* Generic errors */
|
|
class CastingError extends ExtendableError {
|
|
}
|
|
class PlaybackError extends ExtendableError {
|
|
}
|
|
class SoundError extends ExtendableError {
|
|
}
|
|
class TorrentError extends ExtendableError {
|
|
}
|
|
/* Playback */
|
|
class UnplayableTorrentError extends PlaybackError {
|
|
constructor () { super('Can\'t play any files in torrent') }
|
|
}
|
|
class UnplayableFileError extends PlaybackError {
|
|
constructor () { super('Can\'t play that file') }
|
|
}
|
|
/* Sound */
|
|
class InvalidSoundNameError extends SoundError {
|
|
constructor (name) { super(`Invalid sound name: ${name}`) }
|
|
}
|
|
/* Torrent */
|
|
class TorrentKeyNotFoundError extends TorrentError {
|
|
constructor (torrentKey) { super(`Can't resolve torrent key ${torrentKey}`) }
|
|
}
|
|
export { CastingError }
|
|
export { PlaybackError }
|
|
export { SoundError }
|
|
export { TorrentError }
|
|
export { UnplayableTorrentError }
|
|
export { UnplayableFileError }
|
|
export { InvalidSoundNameError }
|
|
export { TorrentKeyNotFoundError }
|
|
export default {
|
|
CastingError,
|
|
PlaybackError,
|
|
SoundError,
|
|
TorrentError,
|
|
UnplayableTorrentError,
|
|
UnplayableFileError,
|
|
InvalidSoundNameError,
|
|
TorrentKeyNotFoundError
|
|
}
|