code: def log_and_raise(msg, exception_class=Error):
      """Logs the given message at ERROR level and raises exception.
  
      Args:
        msg: [`string`]. The message to log and use in the raised exception.
        exception_class: [`Exception`]. The class of exception to raise.
  
      Raises:
        Error: An exception of the type specified by the input exception_class.
      """
      logging.error(msg)
      raise exception_class(msg)
  
file_path: deepvariant/third_party/nucleus/util/errors.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import contextlib
  import errno
  import sys
  from absl import logging
label_desc: Use image node_id 1 for calling a global function with example usage: log_and_raise(msg, exception_class) without return types