Files
MusicMetaFinder-xtrll/src/errors/apiError.js
xtrullor73 a97736abee refactor: remove AuDD references and unused project files
Removed all files, dependencies, and mentions related to the AuDD API. Cleaned up the src directory, removing all non-developed or unused items, as part of a major cleanup. This change is due to the strategic shift towards using audio fingerprinting for song recognition, as opposed to sending the raw audio file itself.
2024-05-09 23:40:46 -07:00

14 lines
389 B
JavaScript

const errorMessages = {
NO_DATA: 'No data received',
NO_RESPONSE: 'No response received',
SETUP_ERROR: 'Error setting up the request',
UNKNOWN_ERROR: 'An unknown error occurred',
};
export default function processApiError(error) {
let errorMessage = errorMessages[error.code] || errorMessages['UNKNOWN_ERROR'];
console.error(errorMessage);
throw new Error(errorMessage);
}