Reworked IMAP setup flow. Implemented easy way to share protocol log on failure if possible.
This commit is contained in:
@@ -4,8 +4,11 @@ namespace Wino.Core.Domain.Exceptions
|
||||
{
|
||||
public class ImapClientPoolException : Exception
|
||||
{
|
||||
public ImapClientPoolException(Exception innerException) : base(Translator.Exception_ImapClientPoolFailed, innerException)
|
||||
public ImapClientPoolException(Exception innerException, string protocolLog) : base(Translator.Exception_ImapClientPoolFailed, innerException)
|
||||
{
|
||||
ProtocolLog = protocolLog;
|
||||
}
|
||||
|
||||
public string ProtocolLog { get; }
|
||||
}
|
||||
}
|
||||
|
||||
21
Wino.Core.Domain/Exceptions/ImapConnectionFailedPackage.cs
Normal file
21
Wino.Core.Domain/Exceptions/ImapConnectionFailedPackage.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using Wino.Core.Domain.Models.AutoDiscovery;
|
||||
|
||||
namespace Wino.Core.Domain.Exceptions
|
||||
{
|
||||
public class ImapConnectionFailedPackage
|
||||
{
|
||||
public ImapConnectionFailedPackage(Exception error, string protocolLog, AutoDiscoverySettings settings)
|
||||
{
|
||||
Error = error;
|
||||
ProtocolLog = protocolLog;
|
||||
Settings = settings;
|
||||
}
|
||||
|
||||
public AutoDiscoverySettings Settings { get; }
|
||||
public Exception Error { get; }
|
||||
public string ProtocolLog { get; }
|
||||
|
||||
public string GetErrorMessage() => Error.InnerException == null ? Error.Message : Error.InnerException.Message;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user