From eeba48795c7fad02157a203941f993949e309431 Mon Sep 17 00:00:00 2001 From: Marcel Fransen Date: Thu, 24 Oct 2024 19:34:44 +0200 Subject: [PATCH 1/3] [DynamicJSONRPCErrorMessage] add to examples --- examples/CMakeLists.txt | 6 ++ .../DynamicJSONRPCErrorMessage/CMakeLists.txt | 56 +++++++++++++ .../DynamicJSONRPCErrorMessage.conf.in | 3 + .../DynamicJSONRPCErrorMessage.cpp | 82 +++++++++++++++++++ .../DynamicJSONRPCErrorMessage.h | 72 ++++++++++++++++ .../DynamicJSONRPCErrorMessagePlugin.json | 13 +++ .../DynamicJSONRPCErrorMessage/Module.cpp | 22 +++++ examples/DynamicJSONRPCErrorMessage/Module.h | 30 +++++++ 8 files changed, 284 insertions(+) create mode 100644 examples/DynamicJSONRPCErrorMessage/CMakeLists.txt create mode 100644 examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.conf.in create mode 100644 examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.cpp create mode 100644 examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.h create mode 100644 examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessagePlugin.json create mode 100644 examples/DynamicJSONRPCErrorMessage/Module.cpp create mode 100644 examples/DynamicJSONRPCErrorMessage/Module.h diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 0bb55862d..3a1adf907 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -36,6 +36,7 @@ option(EXAMPLE_MESSAGECONTROL_UDP_CLIENT "Include UDP output client for message option(EXAMPLE_DYNAMICLOADING "Include dynamic loading examples" OFF) option(EXAMPLE_SIMPLECOMRPC_TEST "Include Simple COMRPC test client" OFF) option(EXAMPLE_PLUGINSMARTINTERFACETYPE_EXAMPLE "Include PluginSmartInterfaceType examples" OFF) +option(EXAMPLE_DYNAMICJSONRPCERRORMESSAGE_EXAMPLE "Include DynamicJSONRPCErrorMessage example" OFF) if(EXAMPLE_COMRPCCLIENT) add_subdirectory(COMRPCClient) @@ -87,3 +88,8 @@ if (EXAMPLE_SIMPLECOMRPC_TEST) add_subdirectory(SimpleCOMRPC/PluginServer) add_subdirectory(SimpleCOMRPC/Client) endif() + +if (EXAMPLE_DYNAMICJSONRPCERRORMESSAGE_EXAMPLE) + add_subdirectory(DynamicJSONRPCErrorMessage) +endif() + diff --git a/examples/DynamicJSONRPCErrorMessage/CMakeLists.txt b/examples/DynamicJSONRPCErrorMessage/CMakeLists.txt new file mode 100644 index 000000000..ae7be999b --- /dev/null +++ b/examples/DynamicJSONRPCErrorMessage/CMakeLists.txt @@ -0,0 +1,56 @@ +# If not stated otherwise in this file or this component's LICENSE file the +# following copyright and licenses apply: +# +# Copyright 2022 Metrological +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +project(DynamicJSONRPCErrorMessage) + +cmake_minimum_required(VERSION 3.15) + +find_package(Thunder) + +project_version(1.0.0) + +set(MODULE_NAME ${NAMESPACE}${PROJECT_NAME}) + +message("Setup ${MODULE_NAME} v${PROJECT_VERSION}") + +find_package(${NAMESPACE}Core REQUIRED) +find_package(${NAMESPACE}Plugins REQUIRED) +find_package(${NAMESPACE}Definitions REQUIRED) +find_package(${NAMESPACE}Messaging REQUIRED) +find_package(CompileSettingsDebug REQUIRED) + +add_library(${MODULE_NAME} SHARED + DynamicJSONRPCErrorMessage.cpp + Module.cpp) + +set_target_properties(${MODULE_NAME} PROPERTIES + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED YES) + +target_link_libraries(${MODULE_NAME} + PRIVATE + ${NAMESPACE}Core::${NAMESPACE}Core + ${NAMESPACE}Plugins::${NAMESPACE}Plugins + ${NAMESPACE}Definitions::${NAMESPACE}Definitions + ${NAMESPACE}Messaging::${NAMESPACE}Messaging + CompileSettingsDebug::CompileSettingsDebug + ${PLUGIN_YIN_DEFINITIONS}) + +install(TARGETS ${MODULE_NAME} +DESTINATION ${CMAKE_INSTALL_LIBDIR}/${STORAGE_DIRECTORY}/plugins COMPONENT ${NAMESPACE}_Runtime) + +write_config() diff --git a/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.conf.in b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.conf.in new file mode 100644 index 000000000..c107660d8 --- /dev/null +++ b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.conf.in @@ -0,0 +1,3 @@ +startmode = "Activated" + + diff --git a/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.cpp b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.cpp new file mode 100644 index 000000000..9b25ac811 --- /dev/null +++ b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.cpp @@ -0,0 +1,82 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2022 Metrological + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Module.h" + +#include "DynamicJSONRPCErrorMessage.h" +#include + +#include + +namespace Thunder { + +namespace Plugin { + + namespace { + static Metadata metadata( + // Version + 1, 0, 0, + // Preconditions + { }, + // Terminations + { }, + // Controls + { } + ); + } + + const string DynamicJSONRPCErrorMessage::Initialize(PluginHost::IShell*) + { + string message{}; + + Exchange::JMath::Register(*this, this); + + return (message); + } + + void DynamicJSONRPCErrorMessage::Deinitialize(PluginHost::IShell* service VARIABLE_IS_NOT_USED) + { + Exchange::JMath::Unregister(*this); + } + + string DynamicJSONRPCErrorMessage::Information() const + { + return {}; + } + + uint32_t DynamicJSONRPCErrorMessage::OnJSONRPCError(const Core::JSONRPC::Context&, const string& designator, const string& parameters, string& errormessage) { + uint32_t result = Core::ERROR_GENERAL; + + string method(Core::JSONRPC::Message::Method(designator)); + + if(method == _T("add")) { + JsonData::Math::AddParamsInfo addparams; + addparams.FromString(parameters); + std::stringstream message; + message <<_T("Error handling add method for some peculiar reason values: ") << addparams.A << _T(" and ") << addparams.B; + errormessage = message.str(); + result = Core::ERROR_INVALID_PARAMETER; + } + return result; + } + + +} // namespace Plugin + +} diff --git a/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.h b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.h new file mode 100644 index 000000000..6c2a70d97 --- /dev/null +++ b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.h @@ -0,0 +1,72 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2022 Metrological + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "Module.h" + +#include + +namespace Thunder { + +namespace Plugin { + + class DynamicJSONRPCErrorMessage : public PluginHost::IPlugin + , public PluginHost::JSONRPCErrorAssessor + , Exchange::IMath { + + public: + DynamicJSONRPCErrorMessage() = default; + ~DynamicJSONRPCErrorMessage() override = default; + + DynamicJSONRPCErrorMessage(const DynamicJSONRPCErrorMessage&) = delete; + DynamicJSONRPCErrorMessage &operator=(const DynamicJSONRPCErrorMessage&) = delete; + DynamicJSONRPCErrorMessage(DynamicJSONRPCErrorMessage&&) = delete; + DynamicJSONRPCErrorMessage &operator=(DynamicJSONRPCErrorMessage&&) = delete; + + public: + // PluginHost::IPlugin overrides + const string Initialize(PluginHost::IShell *service) override; + void Deinitialize(PluginHost::IShell *service) override; + string Information() const override; + + // IMath overrides + uint32_t Add(const uint16_t, const uint16_t, uint16_t&) const override { + return Core::ERROR_USER_DEFINED_JSONRPC; + }; + + uint32_t Sub(const uint16_t, const uint16_t, uint16_t&) const override { + return Core::ERROR_USER_DEFINED_JSONRPC; + } + + // JSONRPCErrorAssessor overrides + uint32_t OnJSONRPCError(const Core::JSONRPC::Context& context, const string& designator, const string& parameters, string& errormessage) override; + + public: + BEGIN_INTERFACE_MAP(DynamicJSONRPCErrorMessage) + INTERFACE_ENTRY(PluginHost::IPlugin) + INTERFACE_ENTRY(PluginHost::IDispatcher) + INTERFACE_ENTRY(Exchange::IMath) + END_INTERFACE_MAP + + }; // class DynamicJSONRPCErrorMessage + +} // namespace Plugin + +} diff --git a/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessagePlugin.json b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessagePlugin.json new file mode 100644 index 000000000..a7a868d9e --- /dev/null +++ b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessagePlugin.json @@ -0,0 +1,13 @@ +{ + "$schema": "plugin.schema.json", + "info": { + "title": "DynamicJSONRPCErrorMessage Plugin", + "callsign": "DynamicJSONRPCErrorMessage", + "locator": "libThunderDynamicJSONRPCErrorMessage.so", + "status": "alpha", + "version": "1.0" + }, + "interface": { + "$ref": "{cppinterfacedir}/IMath.h" + } +} diff --git a/examples/DynamicJSONRPCErrorMessage/Module.cpp b/examples/DynamicJSONRPCErrorMessage/Module.cpp new file mode 100644 index 000000000..b23997577 --- /dev/null +++ b/examples/DynamicJSONRPCErrorMessage/Module.cpp @@ -0,0 +1,22 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2022 Metrological + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Module.h" + +MODULE_NAME_DECLARATION(BUILD_REFERENCE) diff --git a/examples/DynamicJSONRPCErrorMessage/Module.h b/examples/DynamicJSONRPCErrorMessage/Module.h new file mode 100644 index 000000000..3f5bd9bee --- /dev/null +++ b/examples/DynamicJSONRPCErrorMessage/Module.h @@ -0,0 +1,30 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2022 Metrological + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#ifndef MODULE_NAME +#define MODULE_NAME Plugin_DynamicJSONRPCErrorMessage +#endif + +#include +#include + +#undef EXTERNAL +#define EXTERNAL From efa2bf13a7c11ebc57f33e2ebae11d7f8b3e9701 Mon Sep 17 00:00:00 2001 From: Marcel Fransen Date: Fri, 25 Oct 2024 00:59:40 +0200 Subject: [PATCH 2/3] [examples] improved dynamic jsonrpc errormessage example --- .../DynamicJSONRPCErrorMessage.cpp | 19 +++++++--- .../DynamicJSONRPCErrorMessage.h | 36 ++++++++++++++----- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.cpp b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.cpp index 9b25ac811..be90d37cb 100644 --- a/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.cpp +++ b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.cpp @@ -60,22 +60,33 @@ namespace Plugin { return {}; } - uint32_t DynamicJSONRPCErrorMessage::OnJSONRPCError(const Core::JSONRPC::Context&, const string& designator, const string& parameters, string& errormessage) { + uint32_t DynamicJSONRPCErrorMessage::OnJSONRPCError(const Core::JSONRPC::Context&, const string& method, const string& parameters, string& errormessage) { uint32_t result = Core::ERROR_GENERAL; - string method(Core::JSONRPC::Message::Method(designator)); - if(method == _T("add")) { JsonData::Math::AddParamsInfo addparams; addparams.FromString(parameters); std::stringstream message; - message <<_T("Error handling add method for some peculiar reason values: ") << addparams.A << _T(" and ") << addparams.B; + message <<_T("Error handling add method failed for some peculiar reason, values: ") << addparams.A << _T(" and ") << addparams.B; errormessage = message.str(); result = Core::ERROR_INVALID_PARAMETER; } return result; } + uint32_t DynamicJSONRPCErrorMessage::OnJSONRPCErrorMethod(const Core::JSONRPC::Context&, const string& method, const string& parameters, string& errormessage) { + uint32_t result = Core::ERROR_GENERAL; + + if(method == _T("add")) { + JsonData::Math::AddParamsInfo addparams; + addparams.FromString(parameters); + std::stringstream message; + message <<_T("Error handling (method version) add method failed for some peculiar reason, values: ") << addparams.A << _T(" and ") << addparams.B; + errormessage = message.str(); + result = Core::ERROR_INVALID_PARAMETER; + } + return result; + } } // namespace Plugin diff --git a/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.h b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.h index 6c2a70d97..ca9964254 100644 --- a/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.h +++ b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.h @@ -27,12 +27,31 @@ namespace Thunder { namespace Plugin { + +// some examples: +// use 2nd line to call a simple (static) funtion +// use 3rd line to call a more complex function (lamda, bind()) +// use 4th line to have the normal errorhandling +// of course enable the correct accompanying line/part in the c'tor + class DynamicJSONRPCErrorMessage : public PluginHost::IPlugin - , public PluginHost::JSONRPCErrorAssessor - , Exchange::IMath { + , public PluginHost::JSONRPCErrorAssessor +// , public PluginHost::JSONRPCErrorAssessor +// , public PluginHost::JSONRPC + , public Exchange::IMath { public: - DynamicJSONRPCErrorMessage() = default; + DynamicJSONRPCErrorMessage() + : PluginHost::IPlugin() + , PluginHost::JSONRPCErrorAssessor(DynamicJSONRPCErrorMessage::OnJSONRPCError) +/* , PluginHost::JSONRPCErrorAssessor([this](const Core::JSONRPC::Context& context, const string& method, const string& params, string& result) -> uint32_t + { + return OnJSONRPCErrorMethod(context, method, params, result); + })*/ +// , PluginHost::JSONRPC() + , Exchange::IMath() + { + } ~DynamicJSONRPCErrorMessage() override = default; DynamicJSONRPCErrorMessage(const DynamicJSONRPCErrorMessage&) = delete; @@ -48,15 +67,16 @@ namespace Plugin { // IMath overrides uint32_t Add(const uint16_t, const uint16_t, uint16_t&) const override { - return Core::ERROR_USER_DEFINED_JSONRPC; + return Core::ERROR_NOT_SUPPORTED; }; - uint32_t Sub(const uint16_t, const uint16_t, uint16_t&) const override { - return Core::ERROR_USER_DEFINED_JSONRPC; + uint32_t Sub(const uint16_t a, const uint16_t b, uint16_t& result) const override { + result = a - b; + return Core::ERROR_NONE; } - // JSONRPCErrorAssessor overrides - uint32_t OnJSONRPCError(const Core::JSONRPC::Context& context, const string& designator, const string& parameters, string& errormessage) override; + uint32_t OnJSONRPCErrorMethod(const Core::JSONRPC::Context& context, const string& method, const string& parameters, string& errormessage); + static uint32_t OnJSONRPCError(const Core::JSONRPC::Context& context, const string& method, const string& parameters, string& errormessage); public: BEGIN_INTERFACE_MAP(DynamicJSONRPCErrorMessage) From 92085eaaf0f978b477753d45e6aa3be0d55186f5 Mon Sep 17 00:00:00 2001 From: Marcel Fransen Date: Fri, 25 Oct 2024 12:24:28 +0200 Subject: [PATCH 3/3] [examples] show use of errorcode for dynamic jsonrpc errormessages --- .../DynamicJSONRPCErrorMessage.cpp | 22 +++++++------------ .../DynamicJSONRPCErrorMessage.h | 18 +++++++++------ 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.cpp b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.cpp index be90d37cb..069cd7109 100644 --- a/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.cpp +++ b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.cpp @@ -60,32 +60,26 @@ namespace Plugin { return {}; } - uint32_t DynamicJSONRPCErrorMessage::OnJSONRPCError(const Core::JSONRPC::Context&, const string& method, const string& parameters, string& errormessage) { - uint32_t result = Core::ERROR_GENERAL; - - if(method == _T("add")) { + uint32_t DynamicJSONRPCErrorMessage::OnJSONRPCError(const Core::JSONRPC::Context&, const string& method, const string& parameters, const uint32_t errorcode, string& errormessage) { + if((method == _T("add")) && (errorcode == Core::ERROR_GENERAL) ) { JsonData::Math::AddParamsInfo addparams; addparams.FromString(parameters); std::stringstream message; - message <<_T("Error handling add method failed for some peculiar reason, values: ") << addparams.A << _T(" and ") << addparams.B; + message <<_T("Error handling add method failed for general reason, values: ") << addparams.A << _T(" and ") << addparams.B; errormessage = message.str(); - result = Core::ERROR_INVALID_PARAMETER; } - return result; + return errorcode; // one could change/override the errorcode returned by COMRPC but that would not be advised as might be obvious } - uint32_t DynamicJSONRPCErrorMessage::OnJSONRPCErrorMethod(const Core::JSONRPC::Context&, const string& method, const string& parameters, string& errormessage) { - uint32_t result = Core::ERROR_GENERAL; - - if(method == _T("add")) { + uint32_t DynamicJSONRPCErrorMessage::OnJSONRPCErrorMethod(const Core::JSONRPC::Context&, const string& method, const string& parameters, const uint32_t errorcode, string& errormessage) { + if((method == _T("add")) && (errorcode == Core::ERROR_GENERAL) ) { JsonData::Math::AddParamsInfo addparams; addparams.FromString(parameters); std::stringstream message; - message <<_T("Error handling (method version) add method failed for some peculiar reason, values: ") << addparams.A << _T(" and ") << addparams.B; + message <<_T("Error handling (method version) add method failed for general reason, values: ") << addparams.A << _T(" and ") << addparams.B; errormessage = message.str(); - result = Core::ERROR_INVALID_PARAMETER; } - return result; + return errorcode; // one could change/override the errorcode returned by COMRPC but that would not be advised as might be obvious } } // namespace Plugin diff --git a/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.h b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.h index ca9964254..fdc7b7492 100644 --- a/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.h +++ b/examples/DynamicJSONRPCErrorMessage/DynamicJSONRPCErrorMessage.h @@ -44,10 +44,10 @@ namespace Plugin { DynamicJSONRPCErrorMessage() : PluginHost::IPlugin() , PluginHost::JSONRPCErrorAssessor(DynamicJSONRPCErrorMessage::OnJSONRPCError) -/* , PluginHost::JSONRPCErrorAssessor([this](const Core::JSONRPC::Context& context, const string& method, const string& params, string& result) -> uint32_t +/* , PluginHost::JSONRPCErrorAssessor([this](const Core::JSONRPC::Context& context, const string& method, const string& params, const uint32_t errorcode, string& result) -> uint32_t { - return OnJSONRPCErrorMethod(context, method, params, result); - })*/ + return OnJSONRPCErrorMethod(context, method, params, errorcode, result); + }) */ // , PluginHost::JSONRPC() , Exchange::IMath() { @@ -66,8 +66,12 @@ namespace Plugin { string Information() const override; // IMath overrides - uint32_t Add(const uint16_t, const uint16_t, uint16_t&) const override { - return Core::ERROR_NOT_SUPPORTED; + uint32_t Add(const uint16_t a, const uint16_t b , uint16_t&) const override { + uint32_t result = Core::ERROR_NOT_SUPPORTED; + if( a + b == 4 ) { + result = Core::ERROR_GENERAL; + } + return result; }; uint32_t Sub(const uint16_t a, const uint16_t b, uint16_t& result) const override { @@ -75,8 +79,8 @@ namespace Plugin { return Core::ERROR_NONE; } - uint32_t OnJSONRPCErrorMethod(const Core::JSONRPC::Context& context, const string& method, const string& parameters, string& errormessage); - static uint32_t OnJSONRPCError(const Core::JSONRPC::Context& context, const string& method, const string& parameters, string& errormessage); + uint32_t OnJSONRPCErrorMethod(const Core::JSONRPC::Context& context, const string& method, const string& parameters, const uint32_t errorcode, string& errormessage); + static uint32_t OnJSONRPCError(const Core::JSONRPC::Context& context, const string& method, const string& parameters, const uint32_t errorcode, string& errormessage); public: BEGIN_INTERFACE_MAP(DynamicJSONRPCErrorMessage)