def METHOD_NAME(func, *args, **kwargs):
    """Call a MusicBrainz API function and catch exceptions.
    """
    try:
        return func(*args, **kwargs)
    except musicbrainzngs.AuthenticationError:
        raise ui.UserError('authentication with MusicBrainz failed')
    except (musicbrainzngs.ResponseError, musicbrainzngs.NetworkError) as exc:
        raise ui.UserError(f'MusicBrainz API error: {exc}')
    except musicbrainzngs.UsageError:
        raise ui.UserError('MusicBrainz credentials missing')