Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/StackExchange.Redis/RedisChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,12 @@ public static implicit operator RedisChannel(byte[]? key)
{
return Encoding.UTF8.GetString(arr);
}
catch
catch (Exception e) when // Only catch exception throwed by Encoding.UTF8.GetString
(e is DecoderFallbackException
|| e is ArgumentException
|| e is ArgumentNullException)
{
return BitConverter.ToString(arr);
return BitConverter.ToString(arr);
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/StackExchange.Redis/RedisKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,12 @@ public static implicit operator RedisKey(byte[]? key)
{
return Encoding.UTF8.GetString(arr, 0, length);
}
catch
catch (Exception e) when // Only catch exception throwed by Encoding.UTF8.GetString
(e is DecoderFallbackException
|| e is ArgumentException
|| e is ArgumentNullException)
{
return BitConverter.ToString(arr, 0, length);
return BitConverter.ToString(arr, 0, length);
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/StackExchange.Redis/RedisValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,10 @@ private static bool TryParseDouble(ReadOnlySpan<byte> blob, out double value)
{
return Format.GetString(span);
}
catch
catch (Exception e) when // Only catch exception throwed by Encoding.UTF8.GetString
(e is DecoderFallbackException
|| e is ArgumentException
|| e is ArgumentNullException)
{
return ToHex(span);
}
Expand Down
Loading