VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
exception.h 文件参考

VLink-specific exception types wrapping the C++ standard exception hierarchy. 更多...

#include <stdexcept>
exception.h 的引用(Include)关系图:
此图展示该文件被哪些文件直接或间接地引用了:

浏览该文件的源代码.

 Indicates a general runtime failure. 更多...
 Indicates an index or iterator that is outside the valid range. 更多...
 Indicates that a function received an argument with an invalid value. 更多...
 Indicates a violated program logic precondition. 更多...
 Indicates that a value is outside the domain of a mathematical function. 更多...
 Indicates an attempt to exceed the maximum allowable size or length. 更多...
 Indicates an arithmetic range error. 更多...
 Indicates an arithmetic overflow. 更多...
 Indicates an arithmetic underflow. 更多...

命名空间

详细描述

VLink-specific exception types wrapping the C++ standard exception hierarchy.

All VLink exception classes are thin final wrappers that inherit their constructors from the corresponding standard exception base. They are grouped inside the vlink::Exception namespace to avoid naming conflicts with application code.

The mapping between VLink exceptions and standard bases is:

VLink exception Standard base Typical usage
Exception::RuntimeError std::runtime_error General runtime failures (fatal log)
Exception::OutOfRange std::out_of_range Index or iterator out of valid range
Exception::InvalidArgument std::invalid_argument Bad function argument
Exception::LogicError std::logic_error Violated precondition
Exception::DomainError std::domain_error Value outside the function domain
Exception::LengthError std::length_error Size exceeds implementation limit
Exception::RangeError std::range_error Arithmetic range error
Exception::OverflowError std::overflow_error Arithmetic overflow
Exception::UnderflowError std::underflow_error Arithmetic underflow
注解
Exception::RuntimeError is the exception thrown by Logger when a kFatal-level log message is emitted. If a kFatal log occurs the Logger flushes all pending output and then throws this exception, allowing the application to catch it and perform a controlled shutdown.
Example
try {
VLOG_F("Critical failure: ", reason);
} catch (const vlink::Exception::RuntimeError& e) {
// perform cleanup before process exit
std::cerr << e.what() << "\n";
}
#define VLOG_F(...)
定义 logger.h:856