def METHOD_NAME(exception):
    """Convert an unhandled error into an managed error."""
    meta = EXCEPTION_MAP.get(type(exception))
    if meta:
        return meta
    for exception_type, meta in EXCEPTION_MAP.items():
        if isinstance(exception, exception_type):
            return meta
    return EXCEPTION_MAP.get(UnhandledUpstreamException)