// Copyright Epic Games, Inc. All Rights Reserved.
using System;
namespace EpicGames.Horde.Compute
{
///
/// Generic class for compute errors
///
public class ComputeException : Exception
{
///
public ComputeException(string message) : base(message)
{
}
///
public ComputeException(string? message, Exception? innerException) : base(message, innerException)
{
}
}
///
/// Exception thrown for internal reasons
///
public sealed class ComputeInternalException : ComputeException
{
///
/// Constructor
///
///
public ComputeInternalException(string message)
: base(message)
{
}
}
///
/// Exception thrown on a remote machine
///
public sealed class ComputeRemoteException : ComputeException
{
readonly string _description;
///
/// Constructor
///
public ComputeRemoteException(ExceptionMessage message)
: this("Remote exception: " + message.Message, message.Description)
{
}
///
/// Constructor
///
public ComputeRemoteException(string message, string description)
: base(message)
{
_description = "From remote machine: " + description;
}
///
public override string ToString() => _description;
}
}