10#include <rdma/fi_errno.h>
34 template<
typename... T>
42 template<
typename... T>
50 template<
typename... T>
58 template<
typename... T>
66 template<
typename... T>
74 template<
typename... T>
82 template<
typename... T>
88 template<
typename... T>
94 template<
typename... T>
109 char const*
what() const noexcept override;
132 template<
typename... T>
139 int fiErrno() const noexcept;
142 bool isInterrupted() const noexcept;
154 template<typename F, typename... T>
155 int fiCall(F&& fun, std::string_view msg, T&&... args)
157 int result = fun(std::forward<T>(args)...);
160 auto str = ::fi_strerror(result);
static Exception invalidArgument(fmt::format_string< T... > fmt, T &&... args)
Make an MXL_ERR_INVALID_ARG exception.
static Exception interrupted(fmt::format_string< T... > fmt, T &&... args)
Make an MXL_ERR_INTERRUPTED exception.
char const * what() const noexcept override
Implements std::exception, returns a descriptive string about the error.
static Exception internal(fmt::format_string< T... > fmt, T &&... args)
Make an MXL_ERR_INTERNAL exception.
static Exception make(mxlStatus status, fmt::format_string< T... > fmt, T &&... args)
Make any type of exception.
static Exception noFabric(fmt::format_string< T... > fmt, T &&... args)
Exception(std::string msg, mxlStatus status)
static Exception notFound(fmt::format_string< T... > fmt, T &&... args)
Make an MXL_ERR_NOT_FOUND exception.
static Exception unsupportedOperation(fmt::format_string< T... > fmt, T &&... args)
static Exception exists(fmt::format_string< T... > fmt, T &&... args)
Make an MXL_ERR_EXISTS exception.
static Exception invalidState(fmt::format_string< T... > fmt, T &&... args)
Make an MXL_ERR_INVALID_STATE exception.
mxlStatus status() const noexcept
Return the mxlStatus status code that describes the condition that led to the exception being thrown.
An internal exception type that extends.
FabricException(std::string msg, mxlStatus status, int fiErrno)
static FabricException make(int fiErrno, fmt::format_string< T... > fmt, T &&... args)
Create a new exception object.
int fiErrno() const noexcept
mxlStatus
MXL SDK Status codes.
@ MXL_ERR_UNSUPPORTED_OPERATION
void catchAndLogFabricError(F &&fun, std::string_view msg)
int fiCall(F &&fun, std::string_view msg, T &&... args)
Call a libfabric function and check its return code.
mxlStatus mxlStatusFromFiErrno(int fiErrno)
Convert an error code returned by libfabric to an appropriate mxlStatus code.