@@ -22,7 +22,7 @@ namespace Image
22
22
{
23
23
namespace Error
24
24
{
25
- struct UnTarFailure ;
25
+ struct ManifestFileFailure ;
26
26
} // namespace Error
27
27
} // namespace Image
28
28
} // namespace Software
@@ -42,7 +42,7 @@ namespace Image
42
42
{
43
43
namespace Error
44
44
{
45
- struct InternalFailure ;
45
+ struct ImageFailure ;
46
46
} // namespace Error
47
47
} // namespace Image
48
48
} // namespace Software
@@ -62,7 +62,47 @@ namespace Image
62
62
{
63
63
namespace Error
64
64
{
65
- struct ManifestFileFailure ;
65
+ struct BusyFailure ;
66
+ } // namespace Error
67
+ } // namespace Image
68
+ } // namespace Software
69
+ } // namespace openbmc_project
70
+ } // namespace xyz
71
+ } // namespace sdbusplus
72
+
73
+ namespace sdbusplus
74
+ {
75
+ namespace xyz
76
+ {
77
+ namespace openbmc_project
78
+ {
79
+ namespace Software
80
+ {
81
+ namespace Image
82
+ {
83
+ namespace Error
84
+ {
85
+ struct UnTarFailure ;
86
+ } // namespace Error
87
+ } // namespace Image
88
+ } // namespace Software
89
+ } // namespace openbmc_project
90
+ } // namespace xyz
91
+ } // namespace sdbusplus
92
+
93
+ namespace sdbusplus
94
+ {
95
+ namespace xyz
96
+ {
97
+ namespace openbmc_project
98
+ {
99
+ namespace Software
100
+ {
101
+ namespace Image
102
+ {
103
+ namespace Error
104
+ {
105
+ struct InternalFailure ;
66
106
} // namespace Error
67
107
} // namespace Image
68
108
} // namespace Software
@@ -89,38 +129,24 @@ namespace _UnTarFailure
89
129
90
130
struct PATH
91
131
{
92
- static constexpr auto str = " PATH=%s" ;
132
+ /*
133
+ * We can't use -fsanitize=undefined if we declare a
134
+ * 'static constexpr auto str' member, so don't. Instead, open-code the
135
+ * mako template lookups.
136
+ */
93
137
static constexpr auto str_short = " PATH" ;
94
- using type = std::tuple<std::decay_t <decltype (str )>, const char *>;
95
- explicit constexpr PATH (const char * a) : _entry(entry(str , a)){};
138
+ using type = std::tuple<std::decay_t <decltype (" PATH=%s " )>, const char *>;
139
+ explicit constexpr PATH (const char * a) : _entry(entry(" PATH=%s " , a)){};
96
140
type _entry;
97
141
};
98
142
99
143
} // namespace _UnTarFailure
100
144
101
- struct UnTarFailure : public sdbusplus :: exception_t
145
+ struct UnTarFailure
102
146
{
103
- static constexpr auto errName =
104
- " xyz.openbmc_project.Software.Image.UnTarFailure" ;
105
- static constexpr auto errDesc = " An error occurred during untar." ;
106
147
static constexpr auto L = level::ERR;
107
148
using PATH = _UnTarFailure::PATH;
108
149
using metadata_types = std::tuple<PATH>;
109
-
110
- const char * name () const noexcept
111
- {
112
- return errName;
113
- }
114
-
115
- const char * description () const noexcept
116
- {
117
- return errDesc;
118
- }
119
-
120
- const char * what () const noexcept
121
- {
122
- return errName;
123
- }
124
150
};
125
151
126
152
} // namespace Image
@@ -137,6 +163,7 @@ struct map_exception_type<
137
163
{
138
164
using type = xyz::openbmc_project::Software::Image::UnTarFailure;
139
165
};
166
+
140
167
} // namespace details
141
168
142
169
namespace xyz
@@ -152,38 +179,24 @@ namespace _ManifestFileFailure
152
179
153
180
struct PATH
154
181
{
155
- static constexpr auto str = " PATH=%s" ;
182
+ /*
183
+ * We can't use -fsanitize=undefined if we declare a
184
+ * 'static constexpr auto str' member, so don't. Instead, open-code the
185
+ * mako template lookups.
186
+ */
156
187
static constexpr auto str_short = " PATH" ;
157
- using type = std::tuple<std::decay_t <decltype (str )>, const char *>;
158
- explicit constexpr PATH (const char * a) : _entry(entry(str , a)){};
188
+ using type = std::tuple<std::decay_t <decltype (" PATH=%s " )>, const char *>;
189
+ explicit constexpr PATH (const char * a) : _entry(entry(" PATH=%s " , a)){};
159
190
type _entry;
160
191
};
161
192
162
193
} // namespace _ManifestFileFailure
163
194
164
- struct ManifestFileFailure : public sdbusplus :: exception_t
195
+ struct ManifestFileFailure
165
196
{
166
- static constexpr auto errName =
167
- " xyz.openbmc_project.Software.Image.ManifestFileFailure" ;
168
- static constexpr auto errDesc = " An error when reading the Manifest file." ;
169
197
static constexpr auto L = level::ERR;
170
198
using PATH = _ManifestFileFailure::PATH;
171
199
using metadata_types = std::tuple<PATH>;
172
-
173
- const char * name () const noexcept
174
- {
175
- return errName;
176
- }
177
-
178
- const char * description () const noexcept
179
- {
180
- return errDesc;
181
- }
182
-
183
- const char * what () const noexcept
184
- {
185
- return errName;
186
- }
187
200
};
188
201
189
202
} // namespace Image
@@ -200,6 +213,7 @@ struct map_exception_type<sdbusplus::xyz::openbmc_project::Software::Image::
200
213
{
201
214
using type = xyz::openbmc_project::Software::Image::ManifestFileFailure;
202
215
};
216
+
203
217
} // namespace details
204
218
205
219
namespace xyz
@@ -215,39 +229,87 @@ namespace _InternalFailure
215
229
216
230
struct FAIL
217
231
{
218
- static constexpr auto str = " FAIL=%s" ;
232
+ /*
233
+ * We can't use -fsanitize=undefined if we declare a
234
+ * 'static constexpr auto str' member, so don't. Instead, open-code the
235
+ * mako template lookups.
236
+ */
219
237
static constexpr auto str_short = " FAIL" ;
220
- using type = std::tuple<std::decay_t <decltype (str )>, const char *>;
221
- explicit constexpr FAIL (const char * a) : _entry(entry(str , a)){};
238
+ using type = std::tuple<std::decay_t <decltype (" FAIL=%s " )>, const char *>;
239
+ explicit constexpr FAIL (const char * a) : _entry(entry(" FAIL=%s " , a)){};
222
240
type _entry;
223
241
};
224
242
225
243
} // namespace _InternalFailure
226
244
227
- struct InternalFailure : public sdbusplus :: exception_t
245
+ struct InternalFailure
228
246
{
229
- static constexpr auto errName =
230
- " xyz.openbmc_project.Software.Image.InternalFailure" ;
231
- static constexpr auto errDesc =
232
- " The operation failed internally during processing the image." ;
233
247
static constexpr auto L = level::ERR;
234
248
using FAIL = _InternalFailure::FAIL;
235
249
using metadata_types = std::tuple<FAIL>;
250
+ };
251
+
252
+ } // namespace Image
253
+ } // namespace Software
254
+ } // namespace openbmc_project
255
+ } // namespace xyz
256
+
257
+ namespace details
258
+ {
259
+
260
+ template <>
261
+ struct map_exception_type <
262
+ sdbusplus::xyz::openbmc_project::Software::Image::Error::InternalFailure>
263
+ {
264
+ using type = xyz::openbmc_project::Software::Image::InternalFailure;
265
+ };
236
266
237
- const char * name () const noexcept
238
- {
239
- return errName;
240
- }
267
+ } // namespace details
241
268
242
- const char * description () const noexcept
243
- {
244
- return errDesc;
245
- }
269
+ namespace xyz
270
+ {
271
+ namespace openbmc_project
272
+ {
273
+ namespace Software
274
+ {
275
+ namespace Image
276
+ {
277
+ namespace _ImageFailure
278
+ {
246
279
247
- const char * what () const noexcept
248
- {
249
- return errName;
250
- }
280
+ struct FAIL
281
+ {
282
+ /*
283
+ * We can't use -fsanitize=undefined if we declare a
284
+ * 'static constexpr auto str' member, so don't. Instead, open-code the
285
+ * mako template lookups.
286
+ */
287
+ static constexpr auto str_short = " FAIL" ;
288
+ using type = std::tuple<std::decay_t <decltype (" FAIL=%s" )>, const char *>;
289
+ explicit constexpr FAIL (const char * a) : _entry(entry(" FAIL=%s" , a)){};
290
+ type _entry;
291
+ };
292
+ struct PATH
293
+ {
294
+ /*
295
+ * We can't use -fsanitize=undefined if we declare a
296
+ * 'static constexpr auto str' member, so don't. Instead, open-code the
297
+ * mako template lookups.
298
+ */
299
+ static constexpr auto str_short = " PATH" ;
300
+ using type = std::tuple<std::decay_t <decltype (" PATH=%s" )>, const char *>;
301
+ explicit constexpr PATH (const char * a) : _entry(entry(" PATH=%s" , a)){};
302
+ type _entry;
303
+ };
304
+
305
+ } // namespace _ImageFailure
306
+
307
+ struct ImageFailure
308
+ {
309
+ static constexpr auto L = level::ERR;
310
+ using FAIL = _ImageFailure::FAIL;
311
+ using PATH = _ImageFailure::PATH;
312
+ using metadata_types = std::tuple<FAIL, PATH>;
251
313
};
252
314
253
315
} // namespace Image
@@ -260,10 +322,61 @@ namespace details
260
322
261
323
template <>
262
324
struct map_exception_type <
263
- sdbusplus::xyz::openbmc_project::Software::Image::Error::InternalFailure >
325
+ sdbusplus::xyz::openbmc_project::Software::Image::Error::ImageFailure >
264
326
{
265
- using type = xyz::openbmc_project::Software::Image::InternalFailure;
327
+ using type = xyz::openbmc_project::Software::Image::ImageFailure;
328
+ };
329
+
330
+ } // namespace details
331
+
332
+ namespace xyz
333
+ {
334
+ namespace openbmc_project
335
+ {
336
+ namespace Software
337
+ {
338
+ namespace Image
339
+ {
340
+ namespace _BusyFailure
341
+ {
342
+
343
+ struct PATH
344
+ {
345
+ /*
346
+ * We can't use -fsanitize=undefined if we declare a
347
+ * 'static constexpr auto str' member, so don't. Instead, open-code the
348
+ * mako template lookups.
349
+ */
350
+ static constexpr auto str_short = " PATH" ;
351
+ using type = std::tuple<std::decay_t <decltype (" PATH=%s" )>, const char *>;
352
+ explicit constexpr PATH (const char * a) : _entry(entry(" PATH=%s" , a)){};
353
+ type _entry;
266
354
};
355
+
356
+ } // namespace _BusyFailure
357
+
358
+ struct BusyFailure
359
+ {
360
+ static constexpr auto L = level::ERR;
361
+ using PATH = _BusyFailure::PATH;
362
+ using metadata_types = std::tuple<PATH>;
363
+ };
364
+
365
+ } // namespace Image
366
+ } // namespace Software
367
+ } // namespace openbmc_project
368
+ } // namespace xyz
369
+
370
+ namespace details
371
+ {
372
+
373
+ template <>
374
+ struct map_exception_type <
375
+ sdbusplus::xyz::openbmc_project::Software::Image::Error::BusyFailure>
376
+ {
377
+ using type = xyz::openbmc_project::Software::Image::BusyFailure;
378
+ };
379
+
267
380
} // namespace details
268
381
269
382
} // namespace logging
0 commit comments