mirror of
https://github.com/actions/runner.git
synced 2025-12-28 04:17:51 +08:00
Exit hosted runner cleanly during deprovisioning. (#3755)
This commit is contained in:
@@ -7,5 +7,6 @@ namespace GitHub.Actions.RunService.WebApi
|
||||
{
|
||||
public const string RunnerNotFound = "RunnerNotFound";
|
||||
public const string RunnerVersionTooOld = "RunnerVersionTooOld";
|
||||
public const string HostedRunnerDeprovisioned = "HostedRunnerDeprovisioned";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,6 +122,8 @@ namespace GitHub.Actions.RunService.WebApi
|
||||
{
|
||||
ErrorCode = 1
|
||||
};
|
||||
case BrokerErrorKind.HostedRunnerDeprovisioned:
|
||||
throw new HostedRunnerDeprovisionedException(brokerError.Message);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
|
||||
namespace GitHub.Services.WebApi
|
||||
{
|
||||
[Serializable]
|
||||
public sealed class HostedRunnerDeprovisionedException : Exception
|
||||
{
|
||||
public HostedRunnerDeprovisionedException()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public HostedRunnerDeprovisionedException(String message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public HostedRunnerDeprovisionedException(String message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user