Mercurial > hg > orthanc-databases
changeset 822:bc28366a0be3
cleanup: use OrthancPluginException.h instead of custom implementation to show file and line number
line wrap: on
line diff
--- a/Framework/Common/BinaryStringValue.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/BinaryStringValue.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -25,7 +25,7 @@ #include "NullValue.h" -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/lexical_cast.hpp>
--- a/Framework/Common/DatabaseManager.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/DatabaseManager.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -29,7 +29,7 @@ #include <Compatibility.h> // For std::unique_ptr<> #include <Logging.h> -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/thread.hpp> @@ -104,7 +104,7 @@ if (statement.get() == NULL) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } else { @@ -195,13 +195,13 @@ if (database_.get() == NULL) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } dialect_ = database_->GetDialect(); if (dialect_ == Dialect_Unknown) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } @@ -213,7 +213,7 @@ { if (database_.get() == NULL) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } else {
--- a/Framework/Common/DatabasesEnumerations.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/DatabasesEnumerations.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -23,7 +23,7 @@ #include "DatabasesEnumerations.h" -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" namespace OrthancDatabases {
--- a/Framework/Common/Dictionary.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/Dictionary.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -31,7 +31,7 @@ #include "Utf8StringValue.h" #include <Logging.h> -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <cassert>
--- a/Framework/Common/GenericFormatter.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/GenericFormatter.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -23,7 +23,7 @@ #include "GenericFormatter.h" -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/lexical_cast.hpp>
--- a/Framework/Common/IResult.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/IResult.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -26,7 +26,7 @@ #include "Utf8StringValue.h" #include <Compatibility.h> -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <cassert> #include <list>
--- a/Framework/Common/ImplicitTransaction.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/ImplicitTransaction.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -25,7 +25,7 @@ #include <Compatibility.h> // For std::unique_ptr<> #include <Logging.h> -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <memory> @@ -83,7 +83,7 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } @@ -117,7 +117,7 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } }
--- a/Framework/Common/InputFileValue.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/InputFileValue.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -26,7 +26,7 @@ #include "BinaryStringValue.h" #include "NullValue.h" -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/lexical_cast.hpp>
--- a/Framework/Common/Integer32Value.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/Integer32Value.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -27,7 +27,7 @@ #include "NullValue.h" #include "Utf8StringValue.h" -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/lexical_cast.hpp>
--- a/Framework/Common/Integer64Value.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/Integer64Value.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -27,7 +27,7 @@ #include "NullValue.h" #include "Utf8StringValue.h" -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/lexical_cast.hpp>
--- a/Framework/Common/NullValue.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/NullValue.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -25,7 +25,7 @@ #include "Utf8StringValue.h" -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" namespace OrthancDatabases {
--- a/Framework/Common/OrthancFrameworkException.h Tue Jun 02 14:45:33 2026 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/** - * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2026 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2026 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -#pragma once - -#include <OrthancException.h> - -#if ORTHANC_ENABLE_LOGGING == 1 - #define STRINGIFY_LINE_HELPER(line) #line - #define STRINGIFY_LINE(line) STRINGIFY_LINE_HELPER(line) - #define THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(errorCode) throw Orthanc::OrthancException(errorCode, #errorCode " triggered from " __ORTHANC_FILE__ ":" STRINGIFY_LINE(__LINE__)) -#else - #define THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN() throw Orthanc::OrthancException(errorCode) -#endif
--- a/Framework/Common/Query.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/Query.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -24,7 +24,7 @@ #include "Query.h" #include <Logging.h> -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/regex.hpp>
--- a/Framework/Common/ResultBase.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/ResultBase.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -30,7 +30,7 @@ #include <Compatibility.h> // For std::unique_ptr<> #include <Logging.h> -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <cassert> #include <memory> @@ -148,7 +148,7 @@ } else if (fields_[index] == NULL) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } else {
--- a/Framework/Common/ResultFileValue.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/ResultFileValue.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -26,7 +26,7 @@ #include "BinaryStringValue.h" #include "NullValue.h" -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/lexical_cast.hpp>
--- a/Framework/Common/RetryDatabaseFactory.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/RetryDatabaseFactory.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -24,7 +24,7 @@ #include "RetryDatabaseFactory.h" #include <Logging.h> -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/thread.hpp>
--- a/Framework/Common/Utf8StringValue.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Common/Utf8StringValue.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -27,7 +27,7 @@ #include "NullValue.h" #include "Integer64Value.h" -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/lexical_cast.hpp>
--- a/Framework/MySQL/MySQLDatabase.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/MySQL/MySQLDatabase.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -32,7 +32,7 @@ #include <Compatibility.h> // For std::unique_ptr<> #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <Toolbox.h> #include <errmsg.h> @@ -156,7 +156,7 @@ if (mysql_ == NULL) { LOG(ERROR) << "Cannot initialize the MySQL connector"; - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } if (parameters_.GetUnixSocket().empty()) @@ -572,7 +572,7 @@ virtual bool DoesSchemaExist(const std::string& name) ORTHANC_OVERRIDE { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } virtual bool DoesIndexExist(const std::string& name) ORTHANC_OVERRIDE
--- a/Framework/MySQL/MySQLParameters.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/MySQL/MySQLParameters.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -26,7 +26,7 @@ #include "MySQLDatabase.h" #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" namespace OrthancDatabases {
--- a/Framework/MySQL/MySQLResult.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/MySQL/MySQLResult.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -24,7 +24,7 @@ #include "MySQLResult.h" #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <errmsg.h> #include <mysqld_error.h>
--- a/Framework/MySQL/MySQLStatement.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/MySQL/MySQLStatement.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -32,7 +32,7 @@ #include <Compatibility.h> // For std::unique_ptr<> #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <list> #include <memory> @@ -46,7 +46,7 @@ { if (length_ != buffer_.size()) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } switch (mysqlType_) @@ -104,7 +104,7 @@ break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } @@ -177,7 +177,7 @@ default: LOG(ERROR) << "Unsupported MySQL charset: " << field.charsetnr; - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } if (field.max_length > 0) @@ -189,7 +189,7 @@ default: LOG(ERROR) << "MYSQL_TYPE not implemented: " << field.type; - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } @@ -268,7 +268,7 @@ } else { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } @@ -283,7 +283,7 @@ } else { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } }; @@ -375,7 +375,7 @@ if (mysql_stmt_param_count(statement_) != formatter_.GetParametersCount()) { Close(); - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } try @@ -393,7 +393,7 @@ if (result_.size() != result.GetFieldsCount()) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } catch (Orthanc::OrthancException&) @@ -524,7 +524,7 @@ } default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } }
--- a/Framework/MySQL/MySQLTransaction.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/MySQL/MySQLTransaction.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -27,7 +27,7 @@ #include <Compatibility.h> // For std::unique_ptr<> #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <memory>
--- a/Framework/MySQL/MySQLTransaction.h Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/MySQL/MySQLTransaction.h Tue Jun 23 10:15:40 2026 +0200 @@ -29,7 +29,7 @@ #include "MySQLDatabase.h" #include "../Common/ITransaction.h" -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" namespace OrthancDatabases { @@ -67,7 +67,7 @@ virtual bool DoesSchemaExist(const std::string& name) ORTHANC_OVERRIDE { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } virtual bool DoesIndexExist(const std::string& name) ORTHANC_OVERRIDE
--- a/Framework/Odbc/OdbcDatabase.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Odbc/OdbcDatabase.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -31,7 +31,7 @@ #include "OdbcResult.h" #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <Toolbox.h> #include <boost/algorithm/string/predicate.hpp> @@ -86,7 +86,7 @@ virtual bool DoesSchemaExist(const std::string& name) ORTHANC_OVERRIDE { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } virtual bool DoesIndexExist(const std::string& name) ORTHANC_OVERRIDE @@ -200,7 +200,7 @@ virtual bool DoesSchemaExist(const std::string& name) ORTHANC_OVERRIDE { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } virtual bool DoesIndexExist(const std::string& name) ORTHANC_OVERRIDE @@ -619,7 +619,7 @@ break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } }
--- a/Framework/Odbc/OdbcEnvironment.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Odbc/OdbcEnvironment.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -24,7 +24,7 @@ #include "OdbcEnvironment.h" #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/lexical_cast.hpp> #include <sqlext.h>
--- a/Framework/Odbc/OdbcPreparedStatement.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Odbc/OdbcPreparedStatement.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -29,7 +29,7 @@ #include "OdbcResult.h" #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <cassert> #include <sqlext.h> @@ -74,7 +74,7 @@ break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } @@ -151,7 +151,7 @@ break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } SQLLEN null = SQL_NULL_DATA; @@ -229,7 +229,7 @@ } default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } }
--- a/Framework/Odbc/OdbcResult.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Odbc/OdbcResult.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -30,7 +30,7 @@ #include <ChunkedBuffer.h> #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <Toolbox.h> #include <boost/lexical_cast.hpp> @@ -386,7 +386,7 @@ } else if (values_[field] == NULL) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } else {
--- a/Framework/Odbc/OdbcStatement.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Odbc/OdbcStatement.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -27,7 +27,7 @@ #include "OdbcEnvironment.h" #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <sqlext.h>
--- a/Framework/Plugins/DatabaseBackendAdapterV2.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Plugins/DatabaseBackendAdapterV2.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -27,7 +27,7 @@ #include "IndexBackend.h" -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/thread/mutex.hpp> #include <list>
--- a/Framework/Plugins/DatabaseBackendAdapterV3.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Plugins/DatabaseBackendAdapterV3.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -29,7 +29,7 @@ #include "IndexConnectionsPool.h" #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <stdexcept> #include <list> @@ -178,7 +178,7 @@ break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } answerType_ = _OrthancPluginDatabaseAnswerType_None;
--- a/Framework/Plugins/DatabaseBackendAdapterV4.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Plugins/DatabaseBackendAdapterV4.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -34,7 +34,7 @@ #include <OrthancDatabasePlugin.pb.h> // Include protobuf messages #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <stdexcept> #include <list> @@ -506,7 +506,7 @@ case Orthanc::DatabasePluginMessages::OPERATION_FLUSH_TO_DISK: // Raise an exception since "set_supports_flush_to_disk(false)" - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); case Orthanc::DatabasePluginMessages::OPERATION_START_TRANSACTION: { @@ -1273,7 +1273,7 @@ case OrthancPluginResourceType_Instance: if (parent.empty()) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } else { @@ -1284,7 +1284,7 @@ case OrthancPluginResourceType_Patient: if (!parent.empty()) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } break;
--- a/Framework/Plugins/DatabaseConstraint.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Plugins/DatabaseConstraint.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -30,7 +30,7 @@ #include "DatabaseConstraint.h" -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/lexical_cast.hpp> #include <cassert> @@ -278,7 +278,7 @@ } default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } s += "\n";
--- a/Framework/Plugins/ISqlLookupFormatter.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Plugins/ISqlLookupFormatter.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -32,7 +32,7 @@ #include "DatabaseConstraint.h" -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <Toolbox.h> #include <boost/algorithm/string/join.hpp> @@ -60,7 +60,7 @@ return "instances"; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } @@ -83,7 +83,7 @@ return std::string(prefix) + "instances"; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } #endif @@ -124,7 +124,7 @@ break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } std::string parameter = formatter.GenerateParameter(values[0]); @@ -496,7 +496,7 @@ break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } std::string parameter = formatter.GenerateParameter(constraint.GetSingleValue()); @@ -764,7 +764,7 @@ } else { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } @@ -781,7 +781,7 @@ case Orthanc::ResourceType_Instance: return request.orthanc_id_instance(); default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } @@ -828,7 +828,7 @@ FormatJoinForOrdering(orderingJoin, ordering.metadata(), i, queryLevel); break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } orderingJoins += orderingJoin;
--- a/Framework/Plugins/IndexBackend.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Plugins/IndexBackend.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -31,7 +31,7 @@ #include <Compatibility.h> // For std::unique_ptr<> #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <Toolbox.h> #if ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 12, 11) @@ -109,7 +109,7 @@ { if (statement.GetResultFieldsCount() != 1) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } statement.SetResultFieldType(0, ValueType_Integer64); @@ -135,7 +135,7 @@ { if (statement.GetResultFieldsCount() != 1) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } while (!statement.IsDone()) @@ -2001,7 +2001,7 @@ OrthancPluginStorageArea* storageArea) { LOG(ERROR) << "Upgrading database is not implemented by this plugin"; - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } @@ -2519,7 +2519,7 @@ break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } } @@ -2557,7 +2557,7 @@ break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } } @@ -2865,7 +2865,7 @@ { if (statement.GetResultFieldsCount() != 3) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } statement.SetResultFieldType(0, ValueType_Integer64); @@ -2888,7 +2888,7 @@ break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } assert((statement.Next(), statement.IsDone())); @@ -2920,7 +2920,7 @@ { if (statement.GetResultFieldsCount() != 2) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } statement.SetResultFieldType(0, ValueType_Integer64); @@ -3499,7 +3499,7 @@ " INNER JOIN Lookup ON childLevel.parentId = Lookup.internalId"; }; break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } sql += ", _OneInstance AS (" + oneInstanceSqlCTE + ") "; sql += ", OneInstance AS (SELECT parentInternalId, instancePublicId, instanceInternalId FROM _OneInstance WHERE rowNum = 1) "; // this is a generic way to implement DISTINCT ON @@ -4595,7 +4595,7 @@ { if (statement->GetResultFieldsCount() != 2) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } statement->SetResultFieldType(0, ValueType_Utf8String); @@ -4934,7 +4934,7 @@ { if (statement.GetResultFieldsCount() != 7) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } statement.SetResultFieldType(0, ValueType_Utf8String);
--- a/Framework/Plugins/IndexBackend.h Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Plugins/IndexBackend.h Tue Jun 23 10:15:40 2026 +0200 @@ -25,7 +25,7 @@ #include "IDatabaseBackend.h" -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/thread/shared_mutex.hpp> @@ -390,7 +390,7 @@ const char* hashSeries, const char* hashInstance) ORTHANC_OVERRIDE { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } #endif
--- a/Framework/Plugins/IndexUnitTests.h Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Plugins/IndexUnitTests.h Tue Jun 23 10:15:40 2026 +0200 @@ -249,7 +249,7 @@ if (!db.GetKeyValue(value, manager, storeId, item.key()) || value != item.value()) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } } @@ -282,7 +282,7 @@ if (keys.size() != keys2.size()) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } else { @@ -290,7 +290,7 @@ { if (keys2.find(*it) == keys2.end()) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } } @@ -933,7 +933,7 @@ break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } {
--- a/Framework/Plugins/StorageBackend.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/Plugins/StorageBackend.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -32,7 +32,7 @@ #include <Compatibility.h> // For std::unique_ptr<> #include <Logging.h> -#include "../../Framework/Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/thread.hpp> #include <cassert> @@ -349,7 +349,7 @@ { if (success_) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } else { @@ -425,13 +425,13 @@ { if (success_) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } else { if (content.size() != target_->size) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } if (!content.empty()) @@ -543,7 +543,7 @@ { if (success_) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } else if (data_ == NULL) { @@ -730,7 +730,7 @@ { if (success_) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } else { @@ -751,7 +751,7 @@ if (!visitor.IsSuccess()) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } @@ -768,7 +768,7 @@ if (!visitor.IsSuccess()) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } @@ -778,7 +778,7 @@ std::unique_ptr<IAccessor> accessor(CreateAccessor()); if (accessor.get() == NULL) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } #if ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 9, 2)
--- a/Framework/PostgreSQL/PostgreSQLDatabase.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/PostgreSQL/PostgreSQLDatabase.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -31,7 +31,7 @@ #include "PostgreSQLTransaction.h" #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <Toolbox.h> #include <boost/lexical_cast.hpp>
--- a/Framework/PostgreSQL/PostgreSQLLargeObject.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/PostgreSQL/PostgreSQLLargeObject.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -27,7 +27,7 @@ #include "PostgreSQLLargeObject.h" #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/lexical_cast.hpp> #include <libpq/libpq-fs.h> @@ -164,7 +164,7 @@ { if (target.size() != size_) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } PGconn* pg = reinterpret_cast<PGconn*>(database_.pg_);
--- a/Framework/PostgreSQL/PostgreSQLParameters.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/PostgreSQL/PostgreSQLParameters.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -24,7 +24,7 @@ #include "PostgreSQLParameters.h" #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <Toolbox.h> #include <boost/lexical_cast.hpp>
--- a/Framework/PostgreSQL/PostgreSQLResult.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/PostgreSQL/PostgreSQLResult.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -31,7 +31,7 @@ #include "../Common/Utf8StringValue.h" #include <Compatibility.h> // For std::unique_ptr<> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <Logging.h> #include <Endianness.h>
--- a/Framework/PostgreSQL/PostgreSQLStatement.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/PostgreSQL/PostgreSQLStatement.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -35,7 +35,7 @@ #include <Compatibility.h> // For std::unique_ptr<> #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <Toolbox.h> #include <Endianness.h> @@ -580,7 +580,7 @@ } default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } }
--- a/Framework/PostgreSQL/PostgreSQLTransaction.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/PostgreSQL/PostgreSQLTransaction.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -27,7 +27,7 @@ #include <Compatibility.h> // For std::unique_ptr<> #include <Logging.h> -#include "../Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" namespace OrthancDatabases {
--- a/Framework/SQLite/SQLiteDatabase.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/SQLite/SQLiteDatabase.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -27,7 +27,7 @@ #include "SQLiteTransaction.h" #include "../Common/ImplicitTransaction.h" -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <Toolbox.h> namespace OrthancDatabases @@ -80,7 +80,7 @@ virtual bool DoesSchemaExist(const std::string& name) ORTHANC_OVERRIDE { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } virtual bool DoesIndexExist(const std::string& name) ORTHANC_OVERRIDE
--- a/Framework/SQLite/SQLiteResult.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/SQLite/SQLiteResult.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -28,7 +28,7 @@ #include "../Common/NullValue.h" #include "../Common/Utf8StringValue.h" -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" namespace OrthancDatabases { @@ -37,7 +37,7 @@ { if (statement_.GetObject().ColumnCount() < 0) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } else { @@ -67,7 +67,7 @@ case Orthanc::SQLite::COLUMN_TYPE_FLOAT: default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } }
--- a/Framework/SQLite/SQLiteStatement.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/SQLite/SQLiteStatement.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -30,7 +30,7 @@ #include "../Common/Utf8StringValue.h" #include "SQLiteResult.h" -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" namespace OrthancDatabases { @@ -49,7 +49,7 @@ { if (statement_.get() == NULL) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } else { @@ -99,7 +99,7 @@ break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } }
--- a/Framework/SQLite/SQLiteTransaction.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/SQLite/SQLiteTransaction.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -27,7 +27,7 @@ #include "SQLiteStatement.h" #include <Compatibility.h> // For std::unique_ptr<> -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" namespace OrthancDatabases { @@ -39,7 +39,7 @@ if (!transaction_.IsOpen()) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } }
--- a/Framework/SQLite/SQLiteTransaction.h Tue Jun 02 14:45:33 2026 +0200 +++ b/Framework/SQLite/SQLiteTransaction.h Tue Jun 23 10:15:40 2026 +0200 @@ -71,7 +71,7 @@ virtual bool DoesSchemaExist(const std::string& name) ORTHANC_OVERRIDE { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } virtual bool DoesIndexExist(const std::string& name) ORTHANC_OVERRIDE
--- a/MySQL/Plugins/MySQLIndex.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/MySQL/Plugins/MySQLIndex.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -32,7 +32,7 @@ #include <Compatibility.h> // For std::unique_ptr<> #include <Logging.h> -#include "../../Framework/Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <ctype.h> @@ -150,7 +150,7 @@ if (!t.GetDatabaseTransaction().DoesTableExist("PatientRecyclingOrder")) { LOG(ERROR) << "Corrupted MySQL database"; - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } // This is the last item to be created
--- a/Odbc/Plugins/OdbcIndex.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Odbc/Plugins/OdbcIndex.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -30,7 +30,7 @@ #include <EmbeddedResources.h> // Autogenerated file #include <Logging.h> -#include "../../Framework/Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <Toolbox.h> #include <boost/algorithm/string/replace.hpp> @@ -202,7 +202,7 @@ break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } @@ -370,7 +370,7 @@ } default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } @@ -481,7 +481,7 @@ break; default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } @@ -660,7 +660,7 @@ } default: - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } std::string value = boost::lexical_cast<std::string>(seq); @@ -731,14 +731,14 @@ DatabaseManager& manager, const Orthanc::DatabasePluginMessages::Find_Request& request) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } void OdbcIndex::ExecuteCount(Orthanc::DatabasePluginMessages::TransactionResponse& response, DatabaseManager& manager, const Orthanc::DatabasePluginMessages::Find_Request& request) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } #endif }
--- a/PostgreSQL/Plugins/PostgreSQLIndex.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/PostgreSQL/Plugins/PostgreSQLIndex.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -34,7 +34,7 @@ #include <Toolbox.h> #include <SystemToolbox.h> #include <Logging.h> -#include "../../Framework/Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/algorithm/string/join.hpp> @@ -129,7 +129,7 @@ if (!t.GetDatabaseTransaction().DoesSchemaExist(parameters_.GetSchema())) { LOG(ERROR) << "The schema '" << parameters_.GetSchema() << "' does not exist. If you are not using the 'public' schema, you must create the schema manually before starting Orthanc."; - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } if (!t.GetDatabaseTransaction().DoesTableExist("Resources")) @@ -142,7 +142,7 @@ if (!t.GetDatabaseTransaction().DoesTableExist("Resources")) { LOG(ERROR) << "Corrupted PostgreSQL database or failed to create the database schema"; - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } else
--- a/PostgreSQL/UnitTests/PostgreSQLTests.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/PostgreSQL/UnitTests/PostgreSQLTests.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -44,7 +44,7 @@ #include "../Plugins/PostgreSQLStorageArea.h" #include <Compatibility.h> // For std::unique_ptr<> -#include "../../Framework/Common/OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" #include <boost/lexical_cast.hpp>
--- a/Resources/Orthanc/CMake/DownloadPackage.cmake Tue Jun 02 14:45:33 2026 +0200 +++ b/Resources/Orthanc/CMake/DownloadPackage.cmake Tue Jun 23 10:15:40 2026 +0200 @@ -92,7 +92,7 @@ set(TMP_PATH "${CMAKE_SOURCE_DIR}/ThirdPartyDownloads/${TMP_FILENAME}") if (NOT EXISTS "${TMP_PATH}") - message("Downloading ${Url}") + message("Downloading ${Url} since the file was not found in ${TMP_PATH}") # This fixes issue 6: "I think cmake shouldn't download the # packages which are not in the system, it should stop and let
--- a/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -28,7 +28,7 @@ #include <boost/move/unique_ptr.hpp> #include <boost/thread.hpp> #include <boost/algorithm/string/join.hpp> - +#include <limits> #include <json/reader.h> #include <json/version.h> @@ -227,7 +227,7 @@ { Clear(); } - catch (ORTHANC_PLUGINS_EXCEPTION_CLASS&) + catch (ORTHANC_PLUGINS_EXCEPTION_CLASS&) // NOLINT(bugprone-empty-catch) { // Don't throw exceptions in destructors } @@ -264,7 +264,7 @@ } else { - if (size > 0) + if (buffer != NULL && size > 0) { memcpy(buffer_.data, buffer, size); } @@ -675,7 +675,7 @@ { Clear(); } - catch (ORTHANC_PLUGINS_EXCEPTION_CLASS&) + catch (ORTHANC_PLUGINS_EXCEPTION_CLASS&) // NOLINT(bugprone-empty-catch) { // Don't throw exceptions in destructors } @@ -977,7 +977,15 @@ return true; case Json::uintValue: - target = configuration_[key].asUInt(); + if (configuration_[key].asUInt() > static_cast<unsigned int>(std::numeric_limits<int>::max())) + { + ORTHANC_PLUGINS_LOG_ERROR("The configuration option \"" + GetPath(key) + + "\" is too large to fit in an integer"); + + ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat); + } + + target = static_cast<int>(configuration_[key].asUInt()); return true; default: @@ -1338,7 +1346,7 @@ { Clear(); } - catch (ORTHANC_PLUGINS_EXCEPTION_CLASS&) + catch (ORTHANC_PLUGINS_EXCEPTION_CLASS&) // NOLINT(bugprone-empty-catch) { // Don't throw exceptions in destructors }
--- a/Resources/Orthanc/Plugins/OrthancPluginException.h Tue Jun 02 14:45:33 2026 +0200 +++ b/Resources/Orthanc/Plugins/OrthancPluginException.h Tue Jun 23 10:15:40 2026 +0200 @@ -40,14 +40,30 @@ # define ORTHANC_PLUGINS_GET_ERROR_CODE(code) ::OrthancPluginErrorCode_ ## code #endif +#if HAS_ORTHANC_EXCEPTION == 1 && defined(__ORTHANC_FILE__) // the OrthancException accepts a detail argument -> add the file and line number +# define PLUGIN_ORTHANC_EXCEPTION_STRINGIFY_LINE_HELPER(line) #line +# define PLUGIN_ORTHANC_EXCEPTION_STRINGIFY_LINE(line) PLUGIN_ORTHANC_EXCEPTION_STRINGIFY_LINE_HELPER(line) +# define PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(errorCode) \ + throw ::Orthanc::OrthancException( \ + errorCode, #errorCode " triggered from " __ORTHANC_FILE__ ":" \ + PLUGIN_ORTHANC_EXCEPTION_STRINGIFY_LINE(__LINE__)) -#define ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code) \ - throw ORTHANC_PLUGINS_EXCEPTION_CLASS(static_cast<ORTHANC_PLUGINS_ERROR_ENUMERATION>(code)); +# define ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code) \ + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(static_cast<ORTHANC_PLUGINS_ERROR_ENUMERATION>(code)) +# define ORTHANC_PLUGINS_THROW_EXCEPTION(code) \ + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(ORTHANC_PLUGINS_GET_ERROR_CODE(code)) -#define ORTHANC_PLUGINS_THROW_EXCEPTION(code) \ - throw ORTHANC_PLUGINS_EXCEPTION_CLASS(ORTHANC_PLUGINS_GET_ERROR_CODE(code)); - +#else // the PluginException does not accept a detail argument +# define ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code) \ + throw ORTHANC_PLUGINS_EXCEPTION_CLASS(static_cast<ORTHANC_PLUGINS_ERROR_ENUMERATION>(code)); + +# define PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(errorCode) \ + ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(errorCode) + +# define ORTHANC_PLUGINS_THROW_EXCEPTION(code) \ + throw ORTHANC_PLUGINS_EXCEPTION_CLASS(ORTHANC_PLUGINS_GET_ERROR_CODE(code)); +#endif #define ORTHANC_PLUGINS_CHECK_ERROR(code) \ if (code != ORTHANC_PLUGINS_GET_ERROR_CODE(Success)) \
--- a/SQLite/Plugins/SQLiteIndex.cpp Tue Jun 02 14:45:33 2026 +0200 +++ b/SQLite/Plugins/SQLiteIndex.cpp Tue Jun 23 10:15:40 2026 +0200 @@ -32,7 +32,7 @@ #include <Compatibility.h> // For std::unique_ptr<> #include <Logging.h> -#include "OrthancFrameworkException.h" +#include "../../Resources/Orthanc/Plugins/OrthancPluginException.h" namespace OrthancDatabases { @@ -131,7 +131,7 @@ if (!t.GetDatabaseTransaction().DoesTableExist("Resources")) { LOG(ERROR) << "Corrupted SQLite database"; - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } int version = 0; @@ -270,7 +270,7 @@ default: //LOG(ERROR) << value.Format(); - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } } } @@ -289,14 +289,14 @@ DatabaseManager& manager, const Orthanc::DatabasePluginMessages::Find_Request& request) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } void SQLiteIndex::ExecuteCount(Orthanc::DatabasePluginMessages::TransactionResponse& response, DatabaseManager& manager, const Orthanc::DatabasePluginMessages::Find_Request& request) { - THROW_WITH_FILE_AND_LINE_INFO_FROM_PLUGIN(Orthanc::ErrorCode_NotImplemented); + PLUGIN_THROW_WITH_FILE_AND_LINE_INFO(Orthanc::ErrorCode_NotImplemented); } #endif
