Skip to content

Commit e76e5da

Browse files
author
John Gonyo
committed
update GetAsync to return error similar to PerformTryGet
1 parent 85e5d8b commit e76e5da

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Enyim.Caching/MemcachedClient.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ public async Task<IGetOperationResult<T>> GetAsync<T>(string key)
196196
result.Value = transcoder.Deserialize<T>(command.Result);
197197
return result;
198198
}
199+
else
200+
{
201+
commandResult.Combine(result);
202+
203+
return result;
204+
}
199205
}
200206
catch (Exception ex)
201207
{
@@ -208,8 +214,7 @@ public async Task<IGetOperationResult<T>> GetAsync<T>(string key)
208214
_logger.LogError($"Unable to locate memcached node");
209215
}
210216

211-
result.Success = false;
212-
result.Value = default(T);
217+
result.Fail("Unable to locate node");
213218
return result;
214219
}
215220

0 commit comments

Comments
 (0)