Skip to content

Commit

Permalink
fix: mistaken LogError
Browse files Browse the repository at this point in the history
  • Loading branch information
cnblogs-dudu committed Feb 6, 2024
1 parent e431ecc commit 79e37e3
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/Enyim.Caching/MemcachedClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
using Enyim.Caching.Memcached.Results.Factories;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -678,13 +675,17 @@ protected virtual IStoreOperationResult PerformStore(StoreMode mode, string key,
{
CacheItem item;

try { item = _transcoder.Serialize(value); }
catch (Exception e)
try
{
item = _transcoder.Serialize(value);
}
catch (Exception ex)
{
_logger.LogError(0, ex, "PerformStore failed ({err})", ex.Message);
_logger.LogError(ex, "PerformStore failed with '{key}' key", key);

if (!_suppressException) throw;

result.Fail("PerformStore failed", e);
result.Fail("PerformStore failed", ex);
return result;
}

Expand Down

0 comments on commit 79e37e3

Please sign in to comment.