Review usage of Reporter::InternalError, addresses BIT-1045.

Replaced some with InternalWarning or InternalAnalyzerError, the later
being a new method which signals the analyzer to not process further
input.  Some usages I just removed if they didn't make sense or clearly
couldn't happen.  Also did some minor refactors of related code while
reviewing/exploring ways to get rid of InternalError usages.

Also, for TCP content file write failures there's a new event:
"contents_file_write_failure".
This commit is contained in:
Jon Siwek 2013-10-10 14:45:06 -05:00
parent 6734260136
commit b828a6ddc7
51 changed files with 532 additions and 267 deletions

View file

@ -238,7 +238,6 @@ bool Val::DoSerialize(SerialInfo* info) const
return false;
}
reporter->InternalError("should not be reached");
return false;
}
@ -316,7 +315,6 @@ bool Val::DoUnserialize(UnserialInfo* info)
return false;
}
reporter->InternalError("should not be reached");
return false;
}
@ -519,8 +517,9 @@ void Val::ValDescribe(ODesc* d) const
break;
default:
// Don't call Internal(), that'll loop!
reporter->InternalError("Val description unavailable");
reporter->InternalWarning("Val description unavailable");
d->Add("<value description unavailable>");
break;
}
}
@ -1893,7 +1892,7 @@ Val* TableVal::Delete(const Val* index)
Val* va = v ? (v->Value() ? v->Value() : this->Ref()) : 0;
if ( subnets && ! subnets->Remove(index) )
reporter->InternalError("index not in prefix table");
reporter->InternalWarning("index not in prefix table");
if ( LoggingAccess() )
{
@ -1935,7 +1934,7 @@ Val* TableVal::Delete(const HashKey* k)
{
Val* index = table_hash->RecoverVals(k);
if ( ! subnets->Remove(index) )
reporter->InternalError("index not in prefix table");
reporter->InternalWarning("index not in prefix table");
Unref(index);
}
@ -2195,7 +2194,7 @@ void TableVal::DoExpire(double t)
{
Val* index = RecoverIndex(k);
if ( ! subnets->Remove(index) )
reporter->InternalError("index not in prefix table");
reporter->InternalWarning("index not in prefix table");
Unref(index);
}
@ -3300,7 +3299,7 @@ int same_atomic_val(const Val* v1, const Val* v2)
return v1->AsSubNet() == v2->AsSubNet();
default:
reporter->InternalError("same_atomic_val called for non-atomic value");
reporter->InternalWarning("same_atomic_val called for non-atomic value");
return 0;
}