MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / MException

Method MException

Source/Engine/Scripting/Runtime/DotNet.cpp:1337–1358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1335}
1336
1337MException::MException(MObject* exception)
1338 : InnerException(nullptr)
1339{
1340 ASSERT(exception);
1341 MClass* exceptionClass = MCore::Object::GetClass(exception);
1342
1343 MProperty* exceptionMsgProp = exceptionClass->GetProperty("Message");
1344 MMethod* exceptionMsgGetter = exceptionMsgProp->GetGetMethod();
1345 MString* exceptionMsg = (MString*)exceptionMsgGetter->Invoke(exception, nullptr, nullptr);
1346 Message = MUtils::ToString(exceptionMsg);
1347
1348 MProperty* exceptionStackProp = exceptionClass->GetProperty("StackTrace");
1349 MMethod* exceptionStackGetter = exceptionStackProp->GetGetMethod();
1350 MString* exceptionStackTrace = (MString*)exceptionStackGetter->Invoke(exception, nullptr, nullptr);
1351 StackTrace = MUtils::ToString(exceptionStackTrace);
1352
1353 MProperty* innerExceptionProp = exceptionClass->GetProperty("InnerException");
1354 MMethod* innerExceptionGetter = innerExceptionProp->GetGetMethod();
1355 MObject* innerException = (MObject*)innerExceptionGetter->Invoke(exception, nullptr, nullptr);
1356 if (innerException)
1357 InnerException = New<MException>(innerException);
1358}
1359
1360MException::~MException()
1361{

Callers

nothing calls this directly

Calls 5

GetClassFunction · 0.70
ToStringFunction · 0.50
GetPropertyMethod · 0.45
GetGetMethodMethod · 0.45
InvokeMethod · 0.45

Tested by

no test coverage detected