Skip to content

Commit 6aac241

Browse files
authored
refactor(error_handling): Move ErrorCategory definitions from header to source to reduce scope. (#40)
1 parent 894bd14 commit 6aac241

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/ystdlib/error_handling/test/types.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,21 @@
55
#include <string_view>
66
#include <system_error>
77

8+
#include <ystdlib/error_handling/ErrorCode.hpp>
9+
810
#include "constants.hpp"
911

10-
using ystdlib::error_handling::test::AlwaysSuccessErrorCategory;
1112
using ystdlib::error_handling::test::AlwaysSuccessErrorCodeEnum;
12-
using ystdlib::error_handling::test::BinaryErrorCategory;
1313
using ystdlib::error_handling::test::BinaryErrorCodeEnum;
1414
using ystdlib::error_handling::test::cAlwaysSuccessErrorCategoryName;
1515
using ystdlib::error_handling::test::cBinaryTestErrorCategoryName;
1616
using ystdlib::error_handling::test::cFailureConditions;
1717
using ystdlib::error_handling::test::cFailureErrorMsg;
1818
using ystdlib::error_handling::test::cSuccessErrorMsg;
1919
using ystdlib::error_handling::test::cUnrecognizedErrorCode;
20+
using AlwaysSuccessErrorCategory
21+
= ystdlib::error_handling::ErrorCategory<AlwaysSuccessErrorCodeEnum>;
22+
using BinaryErrorCategory = ystdlib::error_handling::ErrorCategory<BinaryErrorCodeEnum>;
2023

2124
template <>
2225
auto AlwaysSuccessErrorCategory::name() const noexcept -> char const* {

src/ystdlib/error_handling/test/types.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ enum class BinaryErrorCodeEnum : uint8_t {
1616
};
1717

1818
using AlwaysSuccessErrorCode = ystdlib::error_handling::ErrorCode<AlwaysSuccessErrorCodeEnum>;
19-
using AlwaysSuccessErrorCategory
20-
= ystdlib::error_handling::ErrorCategory<AlwaysSuccessErrorCodeEnum>;
2119
using BinaryErrorCode = ystdlib::error_handling::ErrorCode<BinaryErrorCodeEnum>;
22-
using BinaryErrorCategory = ystdlib::error_handling::ErrorCategory<BinaryErrorCodeEnum>;
2320
} // namespace ystdlib::error_handling::test
2421

2522
YSTDLIB_ERROR_HANDLING_MARK_AS_ERROR_CODE_ENUM(

0 commit comments

Comments
 (0)