Flow.Launcher/Plugins/Flow.Launcher.Plugin.Explorer/Exceptions/EngineNotAvailableException.cs
Hongtao Zhang 8b1c125bdf
Custom Exception & Some Refactor
- Try use ReadOnlySpan<char> instead of String for applicable API
- Use Customized Exception to return error result
2022-09-21 19:18:20 -05:00

31 lines
869 B
C#

using System;
using Flow.Launcher.Plugin.Explorer.Search.IProvider;
namespace Flow.Launcher.Plugin.Explorer.Exceptions;
public class EngineNotAvailableException : Exception
{
public string EngineName { get; }
public string Resolution { get; }
public EngineNotAvailableException(string engineName,
string resolution,
string message) : base(message)
{
EngineName = engineName;
Resolution = resolution;
}
public EngineNotAvailableException(string engineName,
string resolution,
string message,
Exception innerException) : base(message, innerException)
{
EngineName = engineName;
Resolution = resolution;
}
public override string ToString()
{
return $"Engine {EngineName} is not available.\n Try to {Resolution}\n {base.ToString()}";
}
}