Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/AutomationUtils/AutomationException.cs
jonathan adamczewski 55f53bcc8b ExitCode:
Move enum from AutomationUtils.Automation to BuildUtilities

#jira none
#trivial
#preflight 60ca8a3d78c3b00001f86b24

#ROBOMERGE-SOURCE: CL 16701095 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16701097 by jonathan adamczewski in ue5-release-engine-test branch]
2021-06-17 01:49:34 -04:00

79 lines
2.1 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnrealBuildBase;
namespace AutomationTool
{
/// <summary>
/// How the exception should be output
/// </summary>
public enum AutomationExceptionOutputFormat
{
/// <summary>
/// Do not output any message; just output the exception details to the log.
/// </summary>
Silent,
/// <summary>
/// Output a brief summary to the console, and the exception details to the log
/// </summary>
Minimal,
/// <summary>
/// Treat the exception as an error
/// </summary>
Error
}
/// <summary>
/// Exception class used by the AutomationTool to throw exceptions. Allows setting an exit code that will be passed to the entry routine to return to the system on program exit.
/// If no exit code is given, Error_Unkonwn is used.
/// </summary>
public class AutomationException : System.Exception
{
public ExitCode ErrorCode = ExitCode.Error_Unknown;
public AutomationExceptionOutputFormat OutputFormat = AutomationExceptionOutputFormat.Error;
public AutomationException(string Msg)
:base(Msg)
{
}
public AutomationException(ExitCode ErrorCode, string Msg)
: base(Msg)
{
this.ErrorCode = ErrorCode;
}
public AutomationException(Exception InnerException, string Format, params object[] Args)
: base(string.Format(Format, Args), InnerException)
{
}
public AutomationException(ExitCode ErrorCode, Exception InnerException, string Format, params object[] Args)
: base(string.Format(Format, Args), InnerException)
{
this.ErrorCode = ErrorCode;
}
public AutomationException(string Format, params object[] Args)
: base(string.Format(Format, Args))
{
}
public AutomationException(ExitCode ErrorCode, string Format, params object[] Args)
: base(string.Format(Format, Args))
{
this.ErrorCode = ErrorCode;
}
public override string ToString()
{
return Message;
}
}
}