code: def test_caches_failed_fetches():
      @Promise.safe
      def do():
          def resolve(keys):
              mapped_keys = [
                  Exception("Error: {}".format(key)) for key in keys
              ]
              return Promise.resolve(mapped_keys)
  
          error_loader, load_calls = id_loader(resolve=resolve)
  
          with raises(Exception) as exc_info:
              error_loader.load(1).get()
  
          assert str(exc_info.value) == "Error: 1"
  
          with raises(Exception) as exc_info:
              error_loader.load(1).get()
  
          assert str(exc_info.value) == "Error: 1"
  
          assert load_calls == [[1]]
  
      do().get()
  
imports: from pytest import raises
  from promise import Promise, async_instance
  from promise.dataloader import DataLoader
label_desc: Use image node_id 15 for calling a global function with example usage: test_caches_failed_fetches() and returns: Promise