code: def exception_to_github(github_obj_to_comment, summary=""):
      
      context = ExceptionContext()
      try:
          yield context
      except Exception:  # pylint: disable=broad-except
          if summary:
              summary = ": ({})".format(summary)
          error_type = "an unknown error"
          try:
              raise
          except CalledProcessError as err:
              error_type = "a Subprocess error"
              content = "Command: {}\n".format(err.cmd)
              content += "Finished with return code {}\n".format(err.returncode)
              if err.output:
                  content += "and output:\n```shell\n{}\n```".format(err.output)
              else:
                  content += "and no output"
          except Exception:  # pylint: disable=broad-except
              content = "```python\n{}\n```".format(traceback.format_exc())
          response = "<details><summary>Encountered {}{}</summary><p>\n\n".format(
              error_type,
              summary
          )
          response += content
          response += "\n\n</p></details>"
          context.comment = create_comment(github_obj_to_comment, response)
docs: If any exception comes, log them in the given Github obj.