mirror of
https://github.com/actions/runner.git
synced 2025-12-18 00:07:08 +00:00
GitHub Actions Runner
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.Serialization;
|
||||
using GitHub.Services.WebApi.Internal;
|
||||
|
||||
namespace GitHub.DistributedTask.ObjectTemplating
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides information about an error which occurred during validation.
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
[ClientIgnore]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public class TemplateValidationError
|
||||
{
|
||||
public TemplateValidationError()
|
||||
{
|
||||
}
|
||||
|
||||
public TemplateValidationError(String message)
|
||||
: this(null, message)
|
||||
{
|
||||
}
|
||||
|
||||
public TemplateValidationError(
|
||||
String code,
|
||||
String message)
|
||||
{
|
||||
Code = code;
|
||||
Message = message;
|
||||
}
|
||||
|
||||
[DataMember(EmitDefaultValue = false)]
|
||||
public String Code
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[DataMember(EmitDefaultValue = false)]
|
||||
public String Message
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public static IEnumerable<TemplateValidationError> Create(Exception exception)
|
||||
{
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
yield return new TemplateValidationError(exception.Message);
|
||||
if (exception.InnerException == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
exception = exception.InnerException;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user