| 37 | } |
| 38 | |
| 39 | void Compute(OpKernelContext* ctx) override { |
| 40 | // Log only when CancellationManager is set to skip logging when Compute() |
| 41 | // is called during the optimization phase. |
| 42 | if (ctx->cancellation_manager() && log_error_) { |
| 43 | LOG(ERROR) << "ErrorOp: " << errmsg_; |
| 44 | } |
| 45 | ctx->SetStatus(errors::Internal(errmsg_)); |
| 46 | } |
| 47 | |
| 48 | private: |
| 49 | string errmsg_; |
nothing calls this directly
no test coverage detected