esm
This commit is contained in:
@@ -1,35 +1,37 @@
|
||||
const ExtendableError = require('es6-error')
|
||||
|
||||
import ExtendableError from 'es6-error'
|
||||
/* Generic errors */
|
||||
|
||||
class CastingError extends ExtendableError {}
|
||||
class PlaybackError extends ExtendableError {}
|
||||
class SoundError extends ExtendableError {}
|
||||
class TorrentError extends ExtendableError {}
|
||||
|
||||
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}`) }
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
export { CastingError }
|
||||
export { PlaybackError }
|
||||
export { SoundError }
|
||||
export { TorrentError }
|
||||
export { UnplayableTorrentError }
|
||||
export { UnplayableFileError }
|
||||
export { InvalidSoundNameError }
|
||||
export { TorrentKeyNotFoundError }
|
||||
export default {
|
||||
CastingError,
|
||||
PlaybackError,
|
||||
SoundError,
|
||||
|
||||
Reference in New Issue
Block a user