blob: 260b0c8a7afedc1b897616a2feb476e6e06ae0a6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "storage_reply_error_checker.h"
#include <vespa/storageapi/messageapi/storagereply.h>
#include <vespa/log/log.h>
LOG_SETUP(".storage_reply_error_checker");
namespace feedbm {
StorageReplyErrorChecker::StorageReplyErrorChecker()
: _errors(0u)
{
}
StorageReplyErrorChecker::~StorageReplyErrorChecker() = default;
void
StorageReplyErrorChecker::check_error(const storage::api::StorageMessage &msg)
{
auto reply = dynamic_cast<const storage::api::StorageReply*>(&msg);
if (reply != nullptr) {
if (reply->getResult().failed()) {
if (++_errors <= 10) {
LOG(info, "reply '%s', return code '%s'", reply->toString().c_str(), reply->getResult().toString().c_str());
}
}
} else {
++_errors;
}
}
}
|