37 lines
1.4 KiB
Plaintext
37 lines
1.4 KiB
Plaintext
|
|
namespace DTS.Common.Classes.Locking
|
|
{
|
|
public class LockError
|
|
{
|
|
public int ErrorCode { get; private set; }
|
|
public string Message { get; private set; }
|
|
public string LockingUser { get; private set; }
|
|
public string LockingMachine { get; private set; }
|
|
|
|
public bool LockStolen => ErrorCode == LOCKSTOLEN_ERROR;
|
|
public bool LockLost => ErrorCode == LOCKDOESNTEXIST_ERROR;
|
|
public override string ToString()
|
|
{
|
|
return $"{ErrorCode} - {Message}";
|
|
}
|
|
|
|
public LockError(int error, string message, string user = null, string machine = null)
|
|
{
|
|
ErrorCode = error;
|
|
Message = message;
|
|
LockingUser = user ?? string.Empty;
|
|
LockingMachine = machine ?? string.Empty;
|
|
}
|
|
//14782 Improve lost remote db connection modal dialogs
|
|
//this can apparently be returned by sqlclient on failed lock maintenance issues
|
|
public const int BAD_NETPATH_ERROR = 994;
|
|
//14782 Improve lost remote db connection modal dialogs
|
|
//system error of semaphore timeout, returned by sqlclient on failed to connect issues
|
|
public const int SEM_TIMEOUT_ERROR = 995;
|
|
public const int ITEM_NOT_FOUND = 996;
|
|
public const int LOCKDOESNTEXIST_ERROR = 997;
|
|
public const int LOCKSTOLEN_ERROR = 998;
|
|
public const int UNKNOWN_ERROR = 999;
|
|
}
|
|
}
|