14 #ifndef OR_TOOLS_GLOP_STATUS_H_
15 #define OR_TOOLS_GLOP_STATUS_H_
19 #include "absl/base/port.h"
64 std::string error_message_;
71 #define GLOP_RETURN_IF_ERROR(function_call) \
73 Status return_status = function_call; \
74 if (!return_status.ok()) return return_status; \
78 #define GLOP_RETURN_AND_LOG_ERROR(error_code, message) \
80 std::string error_message = message; \
81 LOG(ERROR) << GetErrorCodeString(error_code) << ": " << error_message; \
82 return Status(error_code, error_message); \
86 #define GLOP_RETURN_ERROR_IF_NULL(arg) \
87 if (arg == nullptr) { \
88 const std::string variable_name = #arg; \
89 std::string error_message = variable_name + " must not be null."; \
90 LOG(DFATAL) << error_message; \
91 return Status(Status::ERROR_NULL, error_message); \
const std::string & error_message() const
ErrorCode error_code() const
std::string GetErrorCodeString(Status::ErrorCode error_code)
Collection of objects used to extend the Constraint Solver library.