MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / WrapThrowableBool

Function WrapThrowableBool

ffi.h:222–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220 */
221 template<typename F>
222 bool WrapThrowableBool(F&& func)
223 {
224 try
225 {
226 if constexpr (std::is_same<typename std::invoke_result<F>::type, bool>::value)
227 {
228 return func();
229 }
230 else
231 {
232 func();
233 return true;
234 }
235 }
236 catch (const std::exception& e)
237 {
238 // TODO: How to handle this?
239 // g_lastExceptionMessage = e.what();
240 LogError("%s", e.what());
241 return false;
242 }
243 catch (...)
244 {
245 return false;
246 }
247 }
248 //endregion
249}

Callers

nothing calls this directly

Calls 1

whatMethod · 0.45

Tested by

no test coverage detected