Changeset 2161 for code/branches/objecthierarchy/src/core
- Timestamp:
- Nov 9, 2008, 4:28:42 AM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/core/Loader.cc
r2019 r2161 37 37 #include "Namespace.h" 38 38 #include "util/Debug.h" 39 #include "util/Exception.h" 39 40 40 41 #include "tinyxml/ticpp.h" … … 157 158 return true; 158 159 } 159 catch(ticpp::Exception& ex) 160 catch (ticpp::Exception& ex) 161 { 162 COUT(1) << std::endl; 163 COUT(1) << "An XML-error occurred in Loader.cc while loading " << file->getFilename() << ":" << std::endl; 164 COUT(1) << ex.what() << std::endl; 165 COUT(1) << "Loading aborted." << std::endl; 166 return false; 167 } 168 catch (Exception& ex) 169 { 170 COUT(1) << std::endl; 171 COUT(1) << "A loading-error occurred in Loader.cc while loading " << file->getFilename() << ":" << std::endl; 172 COUT(1) << ex.what() << std::endl; 173 COUT(1) << "Loading aborted." << std::endl; 174 return false; 175 } 176 catch (std::exception& ex) 160 177 { 161 178 COUT(1) << std::endl; 162 179 COUT(1) << "An error occurred in Loader.cc while loading " << file->getFilename() << ":" << std::endl; 163 180 COUT(1) << ex.what() << std::endl; 181 COUT(1) << "Loading aborted." << std::endl; 182 return false; 183 } 184 catch (...) 185 { 186 COUT(1) << std::endl; 187 COUT(1) << "An unknown error occurred in Loader.cc while loading " << file->getFilename() << ":" << std::endl; 164 188 COUT(1) << "Loading aborted." << std::endl; 165 189 return false; -
code/branches/objecthierarchy/src/core/XMLPort.h
r2114 r2161 44 44 45 45 #include "util/Debug.h" 46 #include "util/Exception.h" 46 47 #include "util/MultiType.h" 47 48 #include "tinyxml/ticpp.h" … … 495 496 if (this->identifierIsIncludedInLoaderMask(identifier)) 496 497 { 497 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "fabricating " << child->Value() << "..." << std::endl; 498 499 BaseObject* newObject = identifier->fabricate((BaseObject*)object); 500 assert(newObject); 501 newObject->setLoaderIndentation(((BaseObject*)object)->getLoaderIndentation() + " "); 502 503 O* castedObject = dynamic_cast<O*>(newObject); 504 assert(castedObject); 505 506 if (this->bLoadBefore_) 498 try 507 499 { 508 newObject->XMLPort(*child, XMLPort::LoadObject); 509 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl; 500 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "fabricating " << child->Value() << "..." << std::endl; 501 502 BaseObject* newObject = identifier->fabricate((BaseObject*)object); 503 assert(newObject); 504 newObject->setLoaderIndentation(((BaseObject*)object)->getLoaderIndentation() + " "); 505 506 O* castedObject = dynamic_cast<O*>(newObject); 507 assert(castedObject); 508 509 if (this->bLoadBefore_) 510 { 511 newObject->XMLPort(*child, XMLPort::LoadObject); 512 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl; 513 } 514 else 515 { 516 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl; 517 } 518 519 COUT(5) << ((BaseObject*)object)->getLoaderIndentation(); 520 (*this->loadexecutor_)(object, castedObject); 521 522 if (!this->bLoadBefore_) 523 newObject->XMLPort(*child, XMLPort::LoadObject); 524 525 COUT(5) << ((BaseObject*)object)->getLoaderIndentation() << "...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl; 510 526 } 511 else527 catch (AbortLoadingException& ex) 512 528 { 513 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl; 529 COUT(1) << "An error occurred while loading object, abort loading..." << std::endl; 530 throw ex; 514 531 } 515 516 COUT(5) << ((BaseObject*)object)->getLoaderIndentation(); 517 (*this->loadexecutor_)(object, castedObject); 518 519 if (!this->bLoadBefore_) 520 newObject->XMLPort(*child, XMLPort::LoadObject); 521 522 COUT(5) << ((BaseObject*)object)->getLoaderIndentation() << "...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl; 532 catch (std::exception& ex) 533 { 534 COUT(1) << "An error occurred while loading object:" << std::endl; 535 COUT(1) << ex.what() << std::endl; 536 } 537 catch (...) 538 { 539 COUT(1) << "An unknown error occurred while loading object." << std::endl; 540 } 523 541 } 524 542 }
Note: See TracChangeset
for help on using the changeset viewer.