Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions agent_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ set(AGENT_SOURCES
# src/sink/rest_sink HEADER_FILE_ONLY

"${SOURCE_DIR}/sink/rest_sink/cached_file.hpp"
"${SOURCE_DIR}/sink/rest_sink/error.hpp"
"${SOURCE_DIR}/sink/rest_sink/file_cache.hpp"
"${SOURCE_DIR}/sink/rest_sink/parameter.hpp"
"${SOURCE_DIR}/sink/rest_sink/request.hpp"
Expand All @@ -274,6 +275,7 @@ set(AGENT_SOURCES

# src/sink/rest_sink SOURCE_FILES_ONLY

"${SOURCE_DIR}/sink/rest_sink/error.cpp"
"${SOURCE_DIR}/sink/rest_sink/file_cache.cpp"
"${SOURCE_DIR}/sink/rest_sink/rest_service.cpp"
"${SOURCE_DIR}/sink/rest_sink/server.cpp"
Expand Down
37 changes: 37 additions & 0 deletions error.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”)
// All rights reserved.
//
// 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 "error.hpp"
#include "mtconnect/entity/factory.hpp"

namespace mtconnect::sink::rest_sink {
using namespace mtconnect::entity;
using namespace std;

entity::FactoryPtr Error::getFactory()
{
static auto error = make_shared<Factory>(Requirements {{"errorCode", true},
{"URI", true},
{"ErrorMessage", false}});

return error;
}



}

49 changes: 49 additions & 0 deletions error.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//
// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”)
// All rights reserved.
//
// 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 "mtconnect/entity/entity.hpp"

namespace mtconnect::sink::rest_sink {

class QueryParameter : public mtconnect::entity::Entity
{


};

class AGENT_LIB_API Error : public mtconnect::entity::Entity {
public:
Error(const std::string &name, const entity::Properties &props)
: entity::Entity(name, props)
{
}
~Error() override = default;

/// @brief get the static error factory
/// @return shared pointer to the factory
static entity::FactoryPtr getFactory();
};

class InvalidParameterValue : public Error
{


};


}

Loading