| 106 | } |
| 107 | |
| 108 | void AppendError(ErrorLogMap* map, const ErrorMsg& e) { |
| 109 | ErrorLogEntryPB* target = &(*map)[e.error()]; |
| 110 | if (e.error() == TErrorCode::GENERAL) { |
| 111 | target->add_messages(e.msg()); |
| 112 | } else { |
| 113 | if (target->messages_size() == 0) { |
| 114 | target->add_messages(e.msg()); |
| 115 | } |
| 116 | target->set_count(target->count() + 1); |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | void ClearErrorMap(ErrorLogMap& errors) { |
| 121 | for (auto& err : errors) { |