mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
parent
b5dd502103
commit
6118ca382a
4 changed files with 41 additions and 4 deletions
|
@ -69,14 +69,14 @@ std::string SrsCplxError::description() {
|
|||
if (desc.empty()) {
|
||||
stringstream ss;
|
||||
ss << "code=" << code;
|
||||
|
||||
|
||||
SrsCplxError* next = this;
|
||||
while (next) {
|
||||
ss << " : " << next->msg;
|
||||
next = next->wrapped;
|
||||
}
|
||||
ss << endl;
|
||||
|
||||
|
||||
next = this;
|
||||
while (next) {
|
||||
ss << "thread [" << getpid() << "][" << next->cid << "]: "
|
||||
|
@ -89,13 +89,29 @@ std::string SrsCplxError::description() {
|
|||
ss << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
desc = ss.str();
|
||||
}
|
||||
|
||||
|
||||
return desc;
|
||||
}
|
||||
|
||||
std::string SrsCplxError::summary() {
|
||||
if (_summary.empty()) {
|
||||
stringstream ss;
|
||||
|
||||
SrsCplxError* next = this;
|
||||
while (next) {
|
||||
ss << " : " << next->msg;
|
||||
next = next->wrapped;
|
||||
}
|
||||
|
||||
_summary = ss.str();
|
||||
}
|
||||
|
||||
return _summary;
|
||||
}
|
||||
|
||||
SrsCplxError* SrsCplxError::create(const char* func, const char* file, int line, int code, const char* fmt, ...) {
|
||||
int rerrno = (int)errno;
|
||||
|
||||
|
@ -178,6 +194,11 @@ string SrsCplxError::description(SrsCplxError* err)
|
|||
return err? err->description() : "Success";
|
||||
}
|
||||
|
||||
string SrsCplxError::summary(SrsCplxError* err)
|
||||
{
|
||||
return err? err->summary() : "Success";
|
||||
}
|
||||
|
||||
int SrsCplxError::error_code(SrsCplxError* err)
|
||||
{
|
||||
return err? err->code : ERROR_SUCCESS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue