code: def test_user_hash_error(self):
      class MyObj:
          # we specify __repr__ here, to avoid `MyObj object at 0x1347a3f70`
          # in error message
          def __repr__(self):
              return "MyObj class"
  
      def bad_hash_func(x):
          x += 10  # Throws a TypeError since x has type MyObj.
          return x
  
      @st.cache_resource(hash_funcs={MyObj: bad_hash_func})
      def user_hash_error_func(x):
          pass
  
      with self.assertRaises(UserHashError) as ctx:
          my_obj = MyObj()
          user_hash_error_func(my_obj)
  
      expected_message = """unsupported operand type(s) for +=: 'MyObj' and 'int'
  
  This error is likely due to a bug in `bad_hash_func()`, which is a
  user-defined hash function that was passed into the `@st.cache_resource` decorator of
  `user_hash_error_func()`.
  
  `bad_hash_func()` failed when hashing an object of type
  `tests.streamlit.runtime.caching.cache_resource_api_test.CacheResourceTest.test_user_hash_error.<locals>.MyObj`.  If you don't know where that object is coming from,
  try looking at the hash chain below for an object that you do recognize, then
  pass that to `hash_funcs` instead:
  
  ```
  Object of type tests.streamlit.runtime.caching.cache_resource_api_test.CacheResourceTest.test_user_hash_error.<locals>.MyObj: MyObj class
  ```
  
  If you think this is actually a Streamlit bug, please
  [file a bug report here](https://github.com/streamlit/streamlit/issues/new/choose)."""
      self.assertEqual(str(ctx.exception), expected_message)
  
imports: import threading
  import unittest
  from typing import Any, List
  from unittest.mock import Mock, patch
  from parameterized import parameterized
  import streamlit
  from streamlit.runtime.caching import cache_resource_api, get_resource_cache_stats_provider
  from streamlit.runtime.caching.cache_type import CacheType
  from streamlit.runtime.caching.cached_message_replay import MultiCacheResults
  from streamlit.runtime.caching.hashing import UserHashError
  from streamlit.runtime.scriptrunner import add_script_run_ctx
  from streamlit.runtime.stats import CacheStat
  from streamlit.vendor.pympler.asizeof import asizeof
  from tests.streamlit.runtime.caching.common_cache_test import as_cached_result
  from tests.testutil import create_mock_script_run_ctx
label_desc: Use image node_id 8 for calling the CacheResourceTest obj's underlying member method code with example usage: obj.test_user_hash_error() and returns: x, str