-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move part of errors.h to a new errors.cpp file
No real changes, just refactoring.
- Loading branch information
Showing
7 changed files
with
102 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,8 @@ | |
B26E2C8F25A245BD008D6DF1 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = B26E2C8B25A245BC008D6DF1 /* [email protected] */; }; | ||
B26E2C9025A245BD008D6DF1 /* CloseButtonTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = B26E2C8C25A245BC008D6DF1 /* CloseButtonTemplate.png */; }; | ||
B26E2C9125A245BD008D6DF1 /* CloseButtonHoverTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = B26E2C8D25A245BD008D6DF1 /* CloseButtonHoverTemplate.png */; }; | ||
B273818C2BD5027E005F24DA /* errors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B273818B2BD5027E005F24DA /* errors.cpp */; }; | ||
B273818D2BD5027E005F24DA /* errors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B273818B2BD5027E005F24DA /* errors.cpp */; }; | ||
B27959DE1E85850A00DBA47D /* qa_checks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27959DC1E85850A00DBA47D /* qa_checks.cpp */; }; | ||
B280E84D1A92776D009F4A98 /* http_client_macos.mm in Sources */ = {isa = PBXBuildFile; fileRef = B280E84B1A92776D009F4A98 /* http_client_macos.mm */; }; | ||
B28602441DDB279400FCA617 /* colorscheme.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B28602421DDB279400FCA617 /* colorscheme.cpp */; }; | ||
|
@@ -388,6 +390,7 @@ | |
B26E2C8B25A245BC008D6DF1 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "macos/[email protected]"; sourceTree = "<group>"; }; | ||
B26E2C8C25A245BC008D6DF1 /* CloseButtonTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CloseButtonTemplate.png; path = macos/CloseButtonTemplate.png; sourceTree = "<group>"; }; | ||
B26E2C8D25A245BD008D6DF1 /* CloseButtonHoverTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CloseButtonHoverTemplate.png; path = macos/CloseButtonHoverTemplate.png; sourceTree = "<group>"; }; | ||
B273818B2BD5027E005F24DA /* errors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = errors.cpp; sourceTree = "<group>"; }; | ||
B27959DC1E85850A00DBA47D /* qa_checks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = qa_checks.cpp; sourceTree = "<group>"; }; | ||
B27959DD1E85850A00DBA47D /* qa_checks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = qa_checks.h; sourceTree = "<group>"; }; | ||
B27D1FC519EFFA2800AB1913 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/InfoPlist.strings; sourceTree = "<group>"; }; | ||
|
@@ -759,6 +762,7 @@ | |
B21B7B481DD4DB9F002A4C62 /* editing_area.h */, | ||
B28F1CBC16F629D30018AF7E /* edlistctrl.cpp */, | ||
B28F1CBD16F629D30018AF7E /* edlistctrl.h */, | ||
B273818B2BD5027E005F24DA /* errors.cpp */, | ||
B29AE89B17105306008D1F8A /* errors.h */, | ||
B28F1CE216F629D30018AF7E /* export_html.cpp */, | ||
B238F674261237C4002D6845 /* filemonitor.cpp */, | ||
|
@@ -1503,6 +1507,7 @@ | |
B28F1CF916F629D30018AF7E /* progressinfo.cpp in Sources */, | ||
B28F1CFA16F629D30018AF7E /* propertiesdlg.cpp in Sources */, | ||
B26D0655182697200069C378 /* welcomescreen.cpp in Sources */, | ||
B273818C2BD5027E005F24DA /* errors.cpp in Sources */, | ||
B2E11F121A2C66FB00E4E42C /* text_control.cpp in Sources */, | ||
B28F1CFB16F629D30018AF7E /* cat_update.cpp in Sources */, | ||
B2CE2FEF1A94EBF50020A620 /* crowdin_client.cpp in Sources */, | ||
|
@@ -1533,6 +1538,7 @@ | |
B260089529AF88A000349A0E /* catalog_json.cpp in Sources */, | ||
B201EBE41DCF8C0100FFB541 /* configuration.cpp in Sources */, | ||
B2DAD7121AD198DE00DCB398 /* language.cpp in Sources */, | ||
B273818D2BD5027E005F24DA /* errors.cpp in Sources */, | ||
B201EBE31DCF8BFD00FFB541 /* catalog.cpp in Sources */, | ||
B2DAD70F1AD1984200DCB398 /* utility.cpp in Sources */, | ||
B260AA682BB2BDAE0003E378 /* unicode_helpers.cpp in Sources */, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* This file is part of Poedit (https://poedit.net) | ||
* | ||
* Copyright (C) 2013-2023 Vaclav Slavik | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a | ||
* copy of this software and associated documentation files (the "Software"), | ||
* to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
* and/or sell copies of the Software, and to permit persons to whom the | ||
* Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
* DEALINGS IN THE SOFTWARE. | ||
* | ||
*/ | ||
|
||
#include "errors.h" | ||
|
||
wxString errors::detail::DescribeExceptionImpl(Rethrower& rethrower) | ||
{ | ||
try | ||
{ | ||
rethrower.rethrow(); | ||
return "no error"; // silence stupid VC++ | ||
} | ||
catch (const Exception& e) | ||
{ | ||
return e.What(); | ||
} | ||
catch (const std::exception& e) | ||
{ | ||
const char *msg = e.what(); | ||
// try interpreting as UTF-8 first as the most likely one (from external sources) | ||
wxString s = wxString::FromUTF8(msg); | ||
if (s.empty()) | ||
{ | ||
s = wxString(msg); | ||
if (s.empty()) // not in current locale either, fall back to Latin1 | ||
s = wxString(msg, wxConvISO8859_1); | ||
} | ||
return s; | ||
} | ||
catch (...) | ||
{ | ||
return "unknown error"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters