forked from rileytestut/AltServer-Windows
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathWindowsError.h
More file actions
41 lines (32 loc) · 1.03 KB
/
WindowsError.h
File metadata and controls
41 lines (32 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include "Error.hpp"
enum class WindowsErrorCode
{
WindowsDefenderBlockedCommunication = 1
};
class WindowsError : public Error
{
public:
WindowsError(WindowsErrorCode code, std::map<std::string, std::any> userInfo = {}) : Error((int)code, userInfo)
{
}
virtual std::string domain() const { return "AltServer.WindowsError"; }
virtual std::optional<std::string> localizedFailureReason() const
{
switch ((WindowsErrorCode)this->code())
{
case WindowsErrorCode::WindowsDefenderBlockedCommunication:
return "Windows Defender blocked SideStore from communicating with SideServer.";
}
return std::nullopt;
}
virtual std::optional<std::string> localizedRecoverySuggestion() const
{
switch ((WindowsErrorCode)this->code())
{
case WindowsErrorCode::WindowsDefenderBlockedCommunication:
return "Disable Windows real-time protection on your computer then try again.";
}
return std::nullopt;
}
};