function handleError(status, remoteURL, fatal) {
    if (!fatal) {
        // File was not loaded correctly, but it is optional.
        // TODO in future, cache the response?
        return null;
    }

    const message = ERROR_MAPPING[status] ?? `Error (${status}) occurred while trying to load file`;
    throw Error(`${message}: "${remoteURL}".`);
}
Helper method to handle fatal errors that occur while trying to load a file from the Hugging Face Hub.
@param {number} status The HTTP status code of the error.
@param {string} remoteURL The URL of the file that could not be loaded.
@param {boolean} fatal Whether to raise an error if the file could not be loaded.
@returns {null} Returns `null` if `fatal = true`.
@throws {Error} If `fatal = false`.