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

Function WrapThrowablePointer

ffi.h:193–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191 */
192 template<typename T, typename F>
193 T WrapThrowablePointer(F&& func, typename std::enable_if<std::is_pointer<T>::value, int>::type _ = 0)
194 {
195 try
196 {
197 return func();
198 }
199 catch (const std::exception& e)
200 {
201 // TODO: How to handle this?
202 // g_lastExceptionMessage = e.what();
203 LogError("%s", e.what());
204 return nullptr;
205 }
206 catch (...)
207 {
208 return nullptr;
209 }
210 }
211
212 /*!
213 Wrap a throwable block in a try/catch, passing through the return value on success.

Callers

nothing calls this directly

Calls 1

whatMethod · 0.45

Tested by

no test coverage detected