< Summary

Information
Class: IceRpc.IceRpcException
Assembly: IceRpc
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc/IceRpcException.cs
Tag: 275_13775359185
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 28
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage
100%
Covered methods: 3
Total methods: 3
Method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_IceRpcError()100%11100%
.ctor(...)100%22100%
.ctor(...)100%11100%

File(s)

/home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc/IceRpcException.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3namespace IceRpc;
 4
 5/// <summary>The IceRPC core and built-in invokers, dispatchers (including built-in middleware and interceptors) report
 6/// errors by throwing this exception.</summary>
 7public class IceRpcException : IOException
 8{
 9    /// <summary>Gets the IceRpc error.</summary>
 10    /// <value>The <see cref="IceRpcError.IceRpcError"/> of this exception.</value>
 67011    public IceRpcError IceRpcError { get; }
 12
 13    /// <summary>Constructs a new instance of the <see cref="IceRpcException" /> class.</summary>
 14    /// <param name="error">The error.</param>
 15    /// <param name="message">A message that describes the exception.</param>
 16    /// <param name="innerException">The exception that caused this exception.</param>
 17    public IceRpcException(IceRpcError error, string? message, Exception? innerException = null)
 690618        : base(message ?? $"An IceRpc call failed with error '{error}'.", innerException) =>
 690619        IceRpcError = error;
 20
 21    /// <summary>Constructs a new instance of the <see cref="IceRpcException" /> class.</summary>
 22    /// <param name="error">The error.</param>
 23    /// <param name="innerException">The exception that caused this exception.</param>
 24    public IceRpcException(IceRpcError error, Exception? innerException = null)
 572125        : this(error, message: null, innerException)
 572126    {
 572127    }
 28}