| 188 | |
| 189 | #ifdef ARROW_EXTRA_ERROR_CONTEXT |
| 190 | void Status::AddContextLine(const char* filename, int line, const char* expr) { |
| 191 | ARROW_CHECK(!ok()) << "Cannot add context line to ok status"; |
| 192 | std::stringstream ss; |
| 193 | ss << "\n" << filename << ":" << line << " " << expr; |
| 194 | if (state_->is_constant) { |
| 195 | // We can't add context lines to a StatusConstant's state, so copy it now |
| 196 | state_ = new State{code(), /*is_constant=*/false, message(), detail()}; |
| 197 | } |
| 198 | state_->msg += ss.str(); |
| 199 | } |
| 200 | #endif |
| 201 | |
| 202 | } // namespace arrow |