< Summary

Information
Class: IceRpc.Internal.DispatchErrorMessage
Assembly: IceRpc
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc/Internal/DispatchErrorMessage.cs
Tag: 2300_35243572715
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 18
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage
100%
Covered methods: 1
Fully covered methods: 1
Total methods: 1
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Compose(...)100%22100%

File(s)

/home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc/Internal/DispatchErrorMessage.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3namespace IceRpc.Internal;
 4
 5/// <summary>Provides a helper method to compose the error message of a failure response.</summary>
 6internal static class DispatchErrorMessage
 7{
 8    /// <summary>Composes the error message of a failure response.</summary>
 9    /// <param name="message">The message that describes the failure.</param>
 10    /// <param name="exception">The exception that is the cause of the failure, or <see langword="null" /> when the
 11    /// failure was not caused by an exception.</param>
 12    /// <returns><paramref name="message" /> when <paramref name="exception" /> is <see langword="null" />; otherwise,
 13    /// <paramref name="message" /> followed by the type and the message of <paramref name="exception" />.</returns>
 14    internal static string Compose(string message, Exception? exception) =>
 15015        exception is null ?
 15016            message :
 15017            $"{message} The failure was caused by an exception of type '{exception.GetType()}' with message: {exception.
 18}