| 1335 | } |
| 1336 | |
| 1337 | MException::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 | |
| 1360 | MException::~MException() |
| 1361 | { |
nothing calls this directly
no test coverage detected