23 std::string&& message);
25 const char* funcName, std::string&&
stack,
26 std::string&& message);
28 int32_t
code() const noexcept {
return m_data->code; }
29 const char*
loc() const noexcept {
return m_data->loc.c_str(); }
30 const char*
stack() const noexcept {
return m_data->stack.c_str(); }
43 std::shared_ptr<Data> m_data;
62void ReportErrorV(int32_t status,
const char* fileName,
int lineNumber,
77template <
typename... Args>
78inline void ReportError(int32_t status,
const char* fileName,
int lineNumber,
103template <
typename... Args>
106 int lineNumber,
const char* funcName,
113#define S(label, offset, message) inline constexpr int label = offset;
119#define S(label, offset, message) inline constexpr int label = offset;
128#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
137#define FRC_ReportError(status, format, ...) \
139 if ((status) != 0) { \
140 ::frc::ReportError(status, __FILE__, __LINE__, __FUNCTION__, \
141 FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__); \
153#define FRC_MakeError(status, format, ...) \
154 ::frc::MakeError(status, __FILE__, __LINE__, __FUNCTION__, \
155 FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__)
164#define FRC_CheckErrorStatus(status, format, ...) \
166 if ((status) < 0) { \
167 throw ::frc::MakeError(status, __FILE__, __LINE__, __FUNCTION__, \
168 FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__); \
169 } else if ((status) > 0) { \
170 ::frc::ReportError(status, __FILE__, __LINE__, __FUNCTION__, \
171 FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__); \
175#define FRC_AssertMessage(condition, format, ...) \
177 if (!(condition)) { \
178 throw ::frc::MakeError(err::AssertionFailure, __FILE__, __LINE__, \
180 FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__); \
184#define FRC_Assert(condition) FRC_AssertMessage(condition, #condition)
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source code
Definition: ThirdPartyNotices.txt:110
Runtime error exception.
Definition: Errors.h:20
RuntimeError(int32_t code, const char *fileName, int lineNumber, const char *funcName, std::string &&stack, std::string &&message)
const char * stack() const noexcept
Definition: Errors.h:30
const char * loc() const noexcept
Definition: Errors.h:29
int32_t code() const noexcept
Definition: Errors.h:28
RuntimeError(int32_t code, std::string &&loc, std::string &&stack, std::string &&message)
void Report() const
Reports error to Driver Station (using HAL_SendError).
basic_string_view< char > string_view
Definition: core.h:501
constexpr auto make_format_args(T &... args) -> format_arg_store< Context, remove_cvref_t< T >... >
\rst Constructs a ~fmtformat_arg_store object that contains references to arguments and can be implic...
Definition: core.h:1824
basic_format_args< format_context > format_args
An alias to basic_format_args<format_context>.
Definition: core.h:1971
Definition: AprilTagPoseEstimator.h:15
RuntimeError MakeError(int32_t status, const char *fileName, int lineNumber, const char *funcName, fmt::string_view format, Args &&... args)
Definition: Errors.h:105
RuntimeError MakeErrorV(int32_t status, const char *fileName, int lineNumber, const char *funcName, fmt::string_view format, fmt::format_args args)
Makes a runtime error exception object.
void ReportError(int32_t status, const char *fileName, int lineNumber, const char *funcName, fmt::string_view format, Args &&... args)
Reports an error to the driver station (using HAL_SendError).
Definition: Errors.h:78
void ReportErrorV(int32_t status, const char *fileName, int lineNumber, const char *funcName, fmt::string_view format, fmt::format_args args)
Reports an error to the driver station (using HAL_SendError).
const char * GetErrorMessage(int32_t *code)
Gets error message string for an error code.
std::basic_string< Char > format(const text_style &ts, const S &format_str, const Args &... args)
\rst Formats arguments and returns the result as a string using ANSI escape sequences to specify text...
Definition: color.h:534