def METHOD_NAME(err: BeancountError) -> SerialisedError:
    """Get a serialisable error from a Beancount error."""
    source = copy(err.source)
    if source is not None:
        source.pop("__tolerances__", None)
    return SerialisedError(err.__class__.__name__, source, err.message)