author | herrick |
Fri, 08 Nov 2019 14:53:03 -0500 | |
branch | JDK-8200758-branch |
changeset 58994 | b09ba68c6a19 |
parent 57413 | src/jdk.jpackage/windows/native/libjpackage/ErrorHandling.h@45c74e654794 |
permissions | -rw-r--r-- |
57413
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
1 |
/* |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
2 |
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
4 |
* |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
10 |
* |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
15 |
* accompanied this code). |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
16 |
* |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
20 |
* |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
23 |
* questions. |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
24 |
*/ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
25 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
26 |
#ifndef ErrorHandling_h |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
27 |
#define ErrorHandling_h |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
28 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
29 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
30 |
#include <stdexcept> |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
31 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
32 |
#include "SourceCodePos.h" |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
33 |
#include "tstrings.h" |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
34 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
35 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
36 |
// |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
37 |
// Exception handling helpers. Allow transparent exception logging. |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
38 |
// Use as follows: |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
39 |
// |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
40 |
// void foo () { |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
41 |
// JP_TRY; |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
42 |
// |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
43 |
// if (!do_something()) { |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
44 |
// JP_THROW("do_something() failed"); |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
45 |
// } |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
46 |
// |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
47 |
// JP_CATCH_ALL; |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
48 |
// } |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
49 |
// |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
50 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
51 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
52 |
// Logs std::exception caught at 'pos'. |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
53 |
void reportError(const SourceCodePos& pos, const std::exception& e); |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
54 |
// Logs unknown exception caught at 'pos'. |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
55 |
// Assumed to be called from catch (...) {} |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
56 |
void reportUnknownError(const SourceCodePos& pos); |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
57 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
58 |
std::string makeMessage(const std::exception& e, const SourceCodePos& pos); |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
59 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
60 |
std::string joinErrorMessages(const std::string& a, const std::string& b); |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
61 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
62 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
63 |
template <class Base> |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
64 |
class JpError: public Base { |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
65 |
public: |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
66 |
JpError(const Base& e, const SourceCodePos& pos): |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
67 |
Base(e), msg(::makeMessage(e, pos)) { |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
68 |
} |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
69 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
70 |
~JpError() throw() { |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
71 |
} |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
72 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
73 |
// override Base::what() |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
74 |
const char* what() const throw() { |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
75 |
return msg.c_str(); |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
76 |
} |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
77 |
private: |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
78 |
// Assert Base is derived from std::exception |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
79 |
enum { isDerivedFromStdException = |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
80 |
sizeof(static_cast<std::exception*>((Base*)0)) }; |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
81 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
82 |
std::string msg; |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
83 |
}; |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
84 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
85 |
template <class T> |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
86 |
inline JpError<T> makeException(const T& obj, const SourceCodePos& p) { |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
87 |
return JpError<T>(obj, p); |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
88 |
} |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
89 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
90 |
inline JpError<std::runtime_error> makeException( |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
91 |
const std::string& msg, const SourceCodePos& p) { |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
92 |
return JpError<std::runtime_error>(std::runtime_error(msg), p); |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
93 |
} |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
94 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
95 |
inline JpError<std::runtime_error> makeException( |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
96 |
const tstrings::any& msg, const SourceCodePos& p) { |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
97 |
return makeException(msg.str(), p); |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
98 |
} |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
99 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
100 |
inline JpError<std::runtime_error> makeException( |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
101 |
std::string::const_pointer msg, const SourceCodePos& p) { |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
102 |
return makeException(std::string(msg), p); |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
103 |
} |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
104 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
105 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
106 |
#define JP_REPORT_ERROR(e) reportError(JP_SOURCE_CODE_POS, e) |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
107 |
#define JP_REPORT_UNKNOWN_ERROR reportUnknownError(JP_SOURCE_CODE_POS) |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
108 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
109 |
// Redefine locally in cpp file(s) if need more handling than just reporting |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
110 |
#define JP_HANDLE_ERROR(e) JP_REPORT_ERROR(e) |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
111 |
#define JP_HANDLE_UNKNOWN_ERROR JP_REPORT_UNKNOWN_ERROR |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
112 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
113 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
114 |
#define JP_TRY \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
115 |
try \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
116 |
{ \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
117 |
do {} while(0) |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
118 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
119 |
#define JP_DEFAULT_CATCH_EXCEPTIONS \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
120 |
JP_CATCH_STD_EXCEPTION \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
121 |
JP_CATCH_UNKNOWN_EXCEPTION |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
122 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
123 |
#define JP_CATCH_EXCEPTIONS \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
124 |
JP_DEFAULT_CATCH_EXCEPTIONS |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
125 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
126 |
#define JP_CATCH_ALL \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
127 |
} \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
128 |
JP_CATCH_EXCEPTIONS \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
129 |
do {} while(0) |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
130 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
131 |
#define JP_CATCH_STD_EXCEPTION \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
132 |
catch (const std::exception& e) \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
133 |
{ \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
134 |
JP_HANDLE_ERROR(e); \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
135 |
} |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
136 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
137 |
#define JP_CATCH_UNKNOWN_EXCEPTION \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
138 |
catch (...) \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
139 |
{ \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
140 |
JP_HANDLE_UNKNOWN_ERROR; \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
141 |
} |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
142 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
143 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
144 |
#define JP_THROW(e) throw makeException((e), JP_SOURCE_CODE_POS) |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
145 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
146 |
#define JP_NO_THROW(expr) \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
147 |
JP_TRY; \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
148 |
expr; \ |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
149 |
JP_CATCH_ALL |
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
150 |
|
45c74e654794
8221333: Replace Inno Setup with custom MSI wrapper for .exe bundler (missed files)
herrick
parents:
diff
changeset
|
151 |
#endif // #ifndef ErrorHandling_h |