Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
Loading...
Searching...
No Matches
error_handling.h File Reference

Error codes and utilities for the thread system. More...

#include <string>
#include <string_view>
#include <system_error>
#include <kcenon/common/patterns/result.h>
Include dependency graph for error_handling.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  kcenon::thread::thread_error_category
 std::error_category implementation for thread_system errors More...
 
struct  std::is_error_code_enum< kcenon::thread::error_code >
 Specialization to enable implicit conversion of thread_system::error_code to std::error_code. More...
 

Namespaces

namespace  kcenon
 
namespace  kcenon::thread
 Core threading foundation of the thread system library.
 
namespace  std
 STL namespace.
 

Enumerations

enum class  kcenon::thread::error_code {
  kcenon::thread::success = 0 , kcenon::thread::unknown_error = -101 , kcenon::thread::operation_canceled = -102 , kcenon::thread::operation_timeout = -103 ,
  kcenon::thread::not_implemented = -104 , kcenon::thread::invalid_argument = -105 , kcenon::thread::thread_already_running = -110 , kcenon::thread::thread_not_running = -111 ,
  kcenon::thread::thread_start_failure = -112 , kcenon::thread::thread_join_failure = -113 , kcenon::thread::queue_full = -120 , kcenon::thread::queue_empty = -121 ,
  kcenon::thread::queue_stopped = -122 , kcenon::thread::queue_busy = -123 , kcenon::thread::job_creation_failed = -130 , kcenon::thread::job_execution_failed = -131 ,
  kcenon::thread::job_invalid = -132 , kcenon::thread::resource_allocation_failed = -140 , kcenon::thread::resource_limit_reached = -141 , kcenon::thread::mutex_error = -150 ,
  kcenon::thread::deadlock_detected = -151 , kcenon::thread::condition_variable_error = -152 , kcenon::thread::io_error = -160 , kcenon::thread::file_not_found = -161 ,
  kcenon::thread::success = 0 , kcenon::thread::unknown_error = -101 , kcenon::thread::operation_canceled = -102 , kcenon::thread::operation_timeout = -103 ,
  kcenon::thread::not_implemented = -104 , kcenon::thread::invalid_argument = -105 , kcenon::thread::thread_already_running = -110 , kcenon::thread::thread_not_running = -111 ,
  kcenon::thread::thread_start_failure = -112 , kcenon::thread::thread_join_failure = -113 , kcenon::thread::queue_full = -120 , kcenon::thread::queue_empty = -121 ,
  kcenon::thread::queue_stopped = -122 , kcenon::thread::queue_busy = -123 , kcenon::thread::job_creation_failed = -130 , kcenon::thread::job_execution_failed = -131 ,
  kcenon::thread::job_invalid = -132 , kcenon::thread::resource_allocation_failed = -140 , kcenon::thread::resource_limit_reached = -141 , kcenon::thread::mutex_error = -150 ,
  kcenon::thread::deadlock_detected = -151 , kcenon::thread::condition_variable_error = -152 , kcenon::thread::io_error = -160 , kcenon::thread::file_not_found = -161 ,
  kcenon::thread::circuit_open = -170 , kcenon::thread::circuit_half_open = -171
}
 

Functions

std::string kcenon::thread::error_code_to_string (error_code code)
 Converts an error_code to a string representation.
 
common::error_info kcenon::thread::to_error_info (error_code code, const std::string &message="")
 Convert a thread::error_code to common::error_info.
 
common::VoidResult kcenon::thread::make_error_result (error_code code, const std::string &message="")
 Create a common::VoidResult error from a thread::error_code.
 
template<typename T >
common::Result< T > kcenon::thread::make_error_result (error_code code, const std::string &message="")
 Create a common::Result<T> error from a thread::error_code.
 
error_code kcenon::thread::get_error_code (const common::error_info &info)
 Extract thread::error_code from a common::error_info.
 
const std::error_category & kcenon::thread::thread_category () noexcept
 Gets the singleton instance of thread_error_category.
 
std::error_code kcenon::thread::make_error_code (error_code e) noexcept
 Creates a std::error_code from a thread_system error_code.
 
std::error_condition kcenon::thread::make_error_condition (error_code e) noexcept
 Creates a std::error_condition from a thread_system error_code.
 

Detailed Description

Error codes and utilities for the thread system.

This file provides thread-system-specific error codes and integration with the common_system Result/VoidResult types for unified error handling.

Note
As of v3.0, all result types have been unified to use kcenon::common::Result<T> and kcenon::common::VoidResult. The legacy thread::result<T>, thread::result_void, and thread::error types have been removed. See docs/ERROR_SYSTEM_MIGRATION_GUIDE.md for migration instructions.

Definition in file error_handling.h.