< Summary

Information
Class: Ice.Internal.Ex
Assembly: Ice
File(s): /home/runner/work/ice/ice/csharp/src/Ice/Internal/Ex.cs
Tag: 71_18251537082
Line coverage
66%
Covered lines: 8
Uncovered lines: 4
Coverable lines: 12
Total lines: 46
Line coverage: 66.6%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage
100%
Covered methods: 2
Total methods: 2
Method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
throwUOE(...)50%2.26260%
throwMemoryLimitException(...)100%11100%

File(s)

/home/runner/work/ice/ice/csharp/src/Ice/Internal/Ex.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3using System.Diagnostics;
 4
 5namespace Ice.Internal;
 6
 7public static class Ex
 8{
 9    public static void throwUOE(Type expectedType, Ice.Value v)
 10    {
 111        if (v is UnknownSlicedValue usv)
 12        {
 013            throw new MarshalException($"The Slice loader did not find a class for type ID '{usv.ice_id()}'.");
 14        }
 15
 116        string type = v.ice_id();
 17        string expected;
 18        try
 19        {
 120            expected = (string)expectedType.GetMethod("ice_staticId").Invoke(null, null);
 121        }
 022        catch (System.Exception)
 23        {
 024            expected = "";
 25            Debug.Assert(false);
 026        }
 27
 128        throw new MarshalException(
 129            $"Failed to unmarshal class with type ID '{expected}': the Slice loader returned class with type ID '{type}'
 30    }
 31
 32    public static void throwMemoryLimitException(int requested, int maximum)
 33    {
 134        throw new MarshalException(
 135            $"Cannot unmarshal Ice message: the message size of {requested} bytes exceeds the maximum allowed of {maximu
 36    }
 37}
 38
 39public class RetryException : System.Exception
 40{
 41    private readonly Ice.LocalException _ex;
 42
 43    public RetryException(Ice.LocalException ex) => _ex = ex;
 44
 45    public Ice.LocalException get() => _ex;
 46}