Files
runner/src/Runner.Worker/ActionNotFoundException.cs

39 lines
1.0 KiB
C#

using System;
using System.Runtime.Serialization;
namespace GitHub.Runner.Worker
{
public class ActionNotFoundException : Exception
{
public ActionNotFoundException(Uri actionUri, string requestId)
: base(FormatMessage(actionUri, requestId))
{
}
public ActionNotFoundException(string message)
: base(message)
{
}
public ActionNotFoundException(string message, System.Exception inner)
: base(message, inner)
{
}
protected ActionNotFoundException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
private static string FormatMessage(Uri actionUri, string requestId)
{
if (!string.IsNullOrEmpty(requestId))
{
return $"An action could not be found at the URI '{actionUri}' ({requestId})";
}
return $"An action could not be found at the URI '{actionUri}'";
}
}
}