class_docstr: Credentials Class Unittest class.
docstr: Test that saving a new Credential catches and logs failures from the segment
  endpoint
code: def test_email_send_exception_handling(self, temp_dir):
      """
      Test that saving a new Credential catches and logs failures from the segment
      endpoint
      """
      with requests_mock.mock() as m:
          m.post("https://api.segment.io/v1/t", status_code=403)
          creds: Credentials = Credentials.get_current()  # type: ignore
          creds._conf_file = str(Path(temp_dir.path) / "config.toml")
          creds.activation = _verify_email("email@test.com")
          with self.assertLogs(
              "streamlit.runtime.credentials", level="ERROR"
          ) as mock_logger:
              creds.save()
              assert len(mock_logger.output) == 1
              assert "Error saving email: 403" in mock_logger.output[0]
  
imports: import os
  import textwrap
  import unittest
  from pathlib import Path
  from unittest.mock import MagicMock, call, mock_open, patch
  import pytest
  import requests_mock
  from testfixtures import tempdir
  from streamlit import file_util
  from streamlit.runtime.credentials import Credentials, _Activation, _verify_email, email_prompt
label_desc: Use image node_id 22 for calling the CredentialsClassTest obj's underlying member method code with example usage: obj.test_email_send_exception_handling(temp_dir) without return types