2023-06-02 21:47:59 +02:00
|
|
|
using System;
|
2020-04-23 17:02:13 -04:00
|
|
|
using System.Runtime.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace GitHub.Runner.Worker
|
|
|
|
|
{
|
|
|
|
|
public class ActionNotFoundException : Exception
|
|
|
|
|
{
|
2023-08-15 19:00:54 -04:00
|
|
|
public ActionNotFoundException(Uri actionUri, string requestId)
|
|
|
|
|
: base(FormatMessage(actionUri, requestId))
|
2020-04-23 17:02:13 -04:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-15 19:00:54 -04:00
|
|
|
private static string FormatMessage(Uri actionUri, string requestId)
|
2020-04-23 17:02:13 -04:00
|
|
|
{
|
2023-08-15 19:00:54 -04:00
|
|
|
if (!string.IsNullOrEmpty(requestId))
|
|
|
|
|
{
|
|
|
|
|
return $"An action could not be found at the URI '{actionUri}' ({requestId})";
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-23 17:02:13 -04:00
|
|
|
return $"An action could not be found at the URI '{actionUri}'";
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-06-02 21:47:59 +02:00
|
|
|
}
|