Skip to content

Commit f9ee740

Browse files
committed
Update error code.
1 parent 757e85d commit f9ee740

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include "QueryHandlerErrorCode.hpp"
2+
3+
#include <ystdlib/error_handling/ErrorCode.hpp>
4+
5+
using clp::ffi::ir_stream::search::QueryHandlerErrorCodeEnum;
6+
using QueryHandlerErrorCategory = ystdlib::error_handling::ErrorCategory<QueryHandlerErrorCodeEnum>;
7+
8+
template <>
9+
auto QueryHandlerErrorCategory::name() const noexcept -> char const* {
10+
return "clp::ffi::ir_stream::search::QueryHandlerError";
11+
}
12+
13+
template <>
14+
auto QueryHandlerErrorCategory::message(QueryHandlerErrorCodeEnum error_enum) const -> std::string {
15+
switch (error_enum) {
16+
case QueryHandlerErrorCodeEnum::MethodNotImplemented:
17+
return "The requested method is not implemented.";
18+
default:
19+
return "Unknown error code enum.";
20+
}
21+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#ifndef CLP_FFI_IR_STREAM_SEARCH_QUERYHANDLERERRORCODE_HPP
2+
#define CLP_FFI_IR_STREAM_SEARCH_QUERYHANDLERERRORCODE_HPP
3+
4+
#include <cstdint>
5+
6+
#include <ystdlib/error_handling/ErrorCode.hpp>
7+
8+
namespace clp::ffi::ir_stream::search {
9+
/**
10+
* This enum class represents all possible error codes related to query handler.
11+
*/
12+
enum class QueryHandlerErrorCodeEnum : uint8_t {
13+
MethodNotImplemented,
14+
};
15+
16+
using QueryHandlerErrorCode = ystdlib::error_handling::ErrorCode<QueryHandlerErrorCodeEnum>;
17+
} // namespace clp::ffi::ir_stream::search
18+
19+
YSTDLIB_ERROR_HANDLING_MARK_AS_ERROR_CODE_ENUM(
20+
clp::ffi::ir_stream::search::QueryHandlerErrorCodeEnum
21+
);
22+
23+
#endif // CLP_FFI_IR_STREAM_SEARCH_QUERYHANDLERERRORCODE_HPP

0 commit comments

Comments
 (0)