| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 * When the code has a systematic way of handling bad_alloc, we'll rethrow (
probably). | 77 * When the code has a systematic way of handling bad_alloc, we'll rethrow (
probably). |
| 78 * Until then, we mask the exception and make no modification. | 78 * Until then, we mask the exception and make no modification. |
| 79 */ | 79 */ |
| 80 } | 80 } |
| 81 catch(...) | 81 catch(...) |
| 82 { | 82 { |
| 83 // no modification if any other exception | 83 // no modification if any other exception |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 void CPluginClientBase::LogPluginError(DWORD errorCode, int errorId, int errorSu
bid, const CString& description, bool isAsync, DWORD dwProcessId, DWORD dwThread
Id) | 87 void CPluginClientBase::LogPluginError(DWORD errorCode, int errorId, int errorSu
bid, const std::string& description, bool isAsync, DWORD dwProcessId, DWORD dwTh
readId) |
| 88 { | 88 { |
| 89 // Prevent circular references | 89 // Prevent circular references |
| 90 if (CPluginSettings::HasInstance() && isAsync) | 90 if (CPluginSettings::HasInstance() && isAsync) |
| 91 { | 91 { |
| 92 DEBUG_ERROR_CODE_EX(errorCode, description, dwProcessId, dwThreadId); | 92 DEBUG_ERROR_CODE_EX(errorCode, description, dwProcessId, dwThreadId); |
| 93 | 93 |
| 94 CString pluginError; | 94 CString pluginError; |
| 95 pluginError.Format(L"%2.2d%2.2d", errorId, errorSubid); | 95 pluginError.Format(L"%2.2d%2.2d", errorId, errorSubid); |
| 96 | 96 |
| 97 CString pluginErrorCode; | 97 CString pluginErrorCode; |
| 98 pluginErrorCode.Format(L"%u", errorCode); | 98 pluginErrorCode.Format(L"%u", errorCode); |
| 99 | 99 |
| 100 CPluginSettings* settings = CPluginSettings::GetInstance(); | 100 CPluginSettings* settings = CPluginSettings::GetInstance(); |
| 101 | 101 |
| 102 settings->AddError(pluginError, pluginErrorCode); | 102 settings->AddError(pluginError, pluginErrorCode); |
| 103 } | 103 } |
| 104 | 104 |
| 105 // Post error to client for later submittal | 105 // Post error to client for later submittal |
| 106 if (!isAsync) | 106 if (!isAsync) |
| 107 { | 107 { |
| 108 CPluginClientBase::PostPluginError(errorId, errorSubid, errorCode, descripti
on); | 108 CPluginClientBase::PostPluginError(errorId, errorSubid, errorCode, descripti
on); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 | 112 |
| 113 void CPluginClientBase::PostPluginError(int errorId, int errorSubid, DWORD error
Code, const CString& errorDescription) | 113 void CPluginClientBase::PostPluginError(int errorId, int errorSubid, DWORD error
Code, const std::string& errorDescription) |
| 114 { | 114 { |
| 115 s_criticalSectionLocal.Lock(); | 115 s_criticalSectionLocal.Lock(); |
| 116 { | 116 { |
| 117 CPluginError pluginError(errorId, errorSubid, errorCode, errorDescription); | 117 CPluginError pluginError(errorId, errorSubid, errorCode, errorDescription); |
| 118 | 118 |
| 119 s_pluginErrors.push_back(pluginError); | 119 s_pluginErrors.push_back(pluginError); |
| 120 } | 120 } |
| 121 s_criticalSectionLocal.Unlock(); | 121 s_criticalSectionLocal.Unlock(); |
| 122 } | 122 } |
| 123 | 123 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 135 | 135 |
| 136 hasError = true; | 136 hasError = true; |
| 137 | 137 |
| 138 s_pluginErrors.erase(it); | 138 s_pluginErrors.erase(it); |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 s_criticalSectionLocal.Unlock(); | 141 s_criticalSectionLocal.Unlock(); |
| 142 | 142 |
| 143 return hasError; | 143 return hasError; |
| 144 } | 144 } |
| OLD | NEW |