< Summary

Information
Class: Anichron.Worker.Ingestion.Proxy.FfmpegException
Assembly: Anichron.Worker
File(s): /home/runner/work/anichron/anichron/src/Anichron.Worker/Ingestion/Proxy/FfmpegException.cs
Tag: 19_45211875487
Line coverage
92%
Covered lines: 12
Uncovered lines: 1
Coverable lines: 13
Total lines: 25
Line coverage: 92.3%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

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

File(s)

/home/runner/work/anichron/anichron/src/Anichron.Worker/Ingestion/Proxy/FfmpegException.cs

#LineLine coverage
 1namespace Anichron.Worker.Ingestion.Proxy;
 2
 3public sealed class FfmpegException : Exception
 4{
 5    public int ExitCode { get; }
 6    public string Stderr { get; } = string.Empty;
 7
 38    public FfmpegException() { }
 99    public FfmpegException(string message) : base(message) { }
 010    public FfmpegException(string message, Exception innerException) : base(message, innerException) { }
 11
 12    public FfmpegException(string ffmpegPath, string arguments, int exitCode, string stderr)
 913        : base(MessageFor(ffmpegPath, arguments, exitCode, stderr))
 914    {
 915        ExitCode = exitCode;
 916        Stderr = stderr;
 917    }
 18
 19    private static string MessageFor(string ffmpegPath, string arguments, int exitCode, string stderr)
 920    {
 921        var command = $"FFmpeg exited with code {exitCode}: {ffmpegPath} {arguments}";
 922        var error = stderr.Trim();
 923        return error.Length == 0 ? command : $"{error}\n{command}";
 924    }
 25}