Skip to content

Commit

Permalink
Revert throw for unexpected default case execution.
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch committed Mar 22, 2024
1 parent a5b0ff9 commit 331eb1a
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ static OtlpCommon.AnyValue DefaultCase(object value)

Debug.Fail("Default case executed");

throw new NotSupportedException($"Type '{value.GetType()}' is not supported");
var stringValue = Convert.ToString(value);

if (stringValue == null)
{
return new();
}

return ToAnyValue(stringValue);
}
}
}

0 comments on commit 331eb1a

Please sign in to comment.