Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/FoxxMD/multi-scrobbler. Scrobble plays from multiple sources to multiple clients docs.multi-scrobbler.app
deezer docker jellyfin koito lastfm listenbrainz maloja mopidy mpris music music-assistant plex scrobble self-hosted spotify subsonic tautulli youtube-music
Something went wrong. Try again.
894 B · 29 lines
TypeScript
at commit fa6ed323
123456789101112131415161718192021222324252627282930import { Response } from 'superagent';
import { findCauseByFunc } from "../../utils/ErrorUtils.js";
export class UpstreamError<T = undefined> extends Error {
showStopper: boolean = false; response?: Response
constructor(message: string, options?: { cause?: T, showStopper?: boolean, response?: Response } | undefined) { super(message, options); const {showStopper = false, response} = options; this.showStopper = showStopper; this.response = response; }}
export const hasUpstreamError = (err: any, showStopping?: boolean): boolean => { return findCauseByFunc(err, (e) => { if (e instanceof UpstreamError) { if (showStopping === undefined) { return true; } else { return e.showStopper === showStopping; } } return false; }) !== undefined;}