|
1 | | -import { serializeError } from "serialize-error"; |
2 | | - |
3 | | -const CLIENT = "[client]"; |
4 | | - |
5 | | -export const ClientErrors = { |
6 | | - analyzeTrackFailed: (trackID: number, err: Error) => |
7 | | - `${CLIENT} error analyzing track ${trackID.toString()}: ${JSON.stringify(serializeError(err))}`, |
8 | | - analyzeTrackTimedOut: (trackID: number) => |
9 | | - `${CLIENT} timed out while analyzing track ${trackID.toString()}`, |
10 | | - analyzeTrackInPlaylistFailed: (trackID: number, playlistID: string, err: Error) => |
11 | | - `${CLIENT} error analyzing track ${trackID.toString()} in playlist ${playlistID}: ${JSON.stringify( |
12 | | - serializeError(err), |
13 | | - )}`, |
14 | | - analyzePlaylistFailed: (playlistID: string) => |
15 | | - `${CLIENT} Unable to analyze playlist ${playlistID}, libraryPlaylists is undefined`, |
16 | | - |
17 | | - contextBridgeResponseTimeout: (channel: string) => |
18 | | - `${CLIENT} Timed out waiting for response to ${channel} event`, |
19 | | - |
20 | | - libraryFailedToLoad: (err: Error) => `${CLIENT} Failed to load library: ${err.message}`, |
21 | | - libraryNoTracksFoundForPlaylist: (playlistID: string) => |
22 | | - `${CLIENT} No track definitions found for playlist ${playlistID}`, |
23 | | - libraryNoTrackDefFound: (trackID: number) => |
24 | | - `${CLIENT} No track definition found for track ${trackID.toString()}`, |
25 | | - libraryWriteTagFailedFileNotFound: (filePath: string) => |
26 | | - `${CLIENT} Failed to write tag to track at ${filePath}: file not found`, |
27 | | - |
28 | | - APP_RENDER_FAILED: `${CLIENT} Failed to render application: no root DOM node available`, |
29 | | - LIBRARY_NOT_LOADED: `${CLIENT} Library is not loaded`, |
30 | | - LIBRARY_WRITE_NO_OUTPUT_FILEPATH: `${CLIENT} No output filepath specified`, |
31 | | - LIBRARY_WRITE_TIMED_OUT: `${CLIENT} Timed out while writing library to disk`, |
32 | | -}; |
33 | | - |
34 | 1 | export const ServerErrors = { |
35 | 2 | AUDIO_FILE_NOT_FOUND: `Audio file not found`, |
36 | 3 | AUDIO_FILES_ROOT_FOLDER_NOT_FOUND: `Audio files root folder does not exist or is empty`, |
37 | 4 | FFMPEG_UNAVAILABLE: `ffmpeg is not available, cannot convert audio files`, |
38 | 5 | MP3_CODEC_UNAVAILABLE: `No MP3 codec is available`, |
39 | 6 | INVALID_CONVERSION_REQUEST: `Invalid MP3 conversion request`, |
40 | 7 | CONVERTED_AUDIO_FILE_NOT_FOUND: `Converted audio file not found`, |
| 8 | + libraryWriteTagFailedFileNotFound: (filePath: string) => |
| 9 | + `Failed to write tag to track at ${filePath}: file not found`, |
41 | 10 | }; |
0 commit comments