comparison Plugins/Engine/OrthancPlugins.cpp @ 1643:87c77b9b3679

provision for error codes in plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Sep 2015 14:42:20 +0200
parents eb8fbcf008b5
children 939b921b2c81
comparison
equal deleted inserted replaced
1642:0669d05b6de1 1643:87c77b9b3679
116 content.resize(static_cast<size_t>(size)); 116 content.resize(static_cast<size_t>(size));
117 } 117 }
118 catch (...) 118 catch (...)
119 { 119 {
120 Free(buffer); 120 Free(buffer);
121 throw; 121 throw OrthancException(ErrorCode_NotEnoughMemory);
122 } 122 }
123 123
124 if (size > 0) 124 if (size > 0)
125 { 125 {
126 memcpy(&content[0], buffer, static_cast<size_t>(size)); 126 memcpy(&content[0], buffer, static_cast<size_t>(size));
741 741
742 void OrthancPlugins::CheckContextAvailable() 742 void OrthancPlugins::CheckContextAvailable()
743 { 743 {
744 if (!pimpl_->context_) 744 if (!pimpl_->context_)
745 { 745 {
746 LOG(ERROR) << "Plugin trying to call the database during its initialization"; 746 throw OrthancException(ErrorCode_DatabaseNotInitialized);
747 throw OrthancException(ErrorCode_Plugin);
748 } 747 }
749 } 748 }
750 749
751 750
752 void OrthancPlugins::GetDicomForInstance(const void* parameters) 751 void OrthancPlugins::GetDicomForInstance(const void* parameters)