#  Copyright (C) 2026
#  ABM, Moscow
#
#  UNPUBLISHED PROPRIETARY MATERIAL.
#  ALL RIGHTS RESERVED.
#
#  Authors: Mike Orlov <m.orlov@abm-jsc.ru>
def write_to_dict_or_raise(container: dict[str, Exception] | None, key: str, exception: Exception) -> None:
    if container is not None:
        container[key] = exception
    else:
        raise exception
