// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. using System; using System.Collections.Generic; using System.Text; namespace UnrealBuildTool { /// /// Base class for exceptions thrown by UBT /// public class BuildException : Exception { /// /// Constructor /// /// Format for the message string /// Format arguments public BuildException(string MessageFormat, params Object[] MessageObjects) : base("ERROR: " + string.Format(MessageFormat, MessageObjects)) { } /// /// Constructor which wraps another exception /// /// The inner exception being wrapped /// Format for the message string /// Format arguments public BuildException(Exception InnerException, string MessageFormat, params Object[] MessageObjects) : base("ERROR: " + string.Format(MessageFormat, MessageObjects), InnerException) { } /// /// Returns the string representing the exception. Our build exceptions do not show the callstack since they are used to report known error conditions. /// /// Message for the exception public override string ToString() { if (Message != null && Message.Length > 0) { return Message; } else { return base.ToString(); } } }; class MissingModuleException : BuildException { public MissingModuleException(string InModuleName) : base("Couldn't find module rules file for module '{0}'.", InModuleName) { ModuleName = InModuleName; } public string ModuleName; }; }