| 91 | } |
| 92 | |
| 93 | bool reportErrorAndAllowRetry(std::string_view msg) |
| 94 | { |
| 95 | logError(msg); |
| 96 | |
| 97 | if (is_set(gErrorDiagnosticFlags, ErrorDiagnosticFlags::ShowMessageBoxOnError)) |
| 98 | { |
| 99 | enum ButtonId |
| 100 | { |
| 101 | Retry, |
| 102 | Abort |
| 103 | }; |
| 104 | |
| 105 | // Setup message box buttons |
| 106 | std::vector<MsgBoxCustomButton> buttons; |
| 107 | buttons.push_back({Retry, "Retry"}); |
| 108 | buttons.push_back({Abort, "Abort"}); |
| 109 | |
| 110 | // Show message box |
| 111 | auto result = msgBox("Error", std::string(msg), buttons, MsgBoxIcon::Error); |
| 112 | return result == Retry; |
| 113 | } |
| 114 | |
| 115 | return false; |
| 116 | } |
| 117 | |
| 118 | [[noreturn]] void reportFatalErrorAndTerminate(std::string_view msg) |
| 119 | { |