| 37 | bool StatusScopedDiagnosticHandler::ok() const { return diag_str_.empty(); } |
| 38 | |
| 39 | Status StatusScopedDiagnosticHandler::ConsumeStatus() { |
| 40 | if (ok()) return Status::OK(); |
| 41 | |
| 42 | // TODO(jpienaar) This should be combining status with one previously built |
| 43 | // up. |
| 44 | Status s = tensorflow::errors::Unknown(diag_str_); |
| 45 | diag_str_.clear(); |
| 46 | return s; |
| 47 | } |
| 48 | |
| 49 | Status StatusScopedDiagnosticHandler::Combine(Status status) { |
| 50 | if (status.ok()) return ConsumeStatus(); |