14#ifndef OR_TOOLS_GLOP_STATUS_H_
15#define OR_TOOLS_GLOP_STATUS_H_
19#include "absl/base/port.h"
65 std::string error_message_;
72#define GLOP_RETURN_IF_ERROR(function_call) \
74 Status return_status = function_call; \
75 if (!return_status.ok()) return return_status; \
79#define GLOP_RETURN_AND_LOG_ERROR(error_code, message) \
81 std::string error_message = message; \
82 LOG(ERROR) << GetErrorCodeString(error_code) << ": " << error_message; \
83 return Status(error_code, error_message); \
87#define GLOP_RETURN_ERROR_IF_NULL(arg) \
88 if (arg == nullptr) { \
89 const std::string variable_name = #arg; \
90 std::string error_message = variable_name + " must not be null."; \
91 LOG(DFATAL) << error_message; \
92 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.