7 #include "packager/media/base/status.h"
9 #include "packager/base/logging.h"
10 #include "packager/base/strings/stringprintf.h"
17 std::string ErrorCodeToString(Code error_code) {
25 case INVALID_ARGUMENT:
26 return "INVALID_ARGUMENT";
28 return "UNIMPLEMENTED";
30 return "FILE_FAILURE";
32 return "END_OF_STREAM";
34 return "HTTP_FAILURE";
36 return "PARSER_FAILURE";
38 return "MUXER_FAILURE";
39 case FRAGMENT_FINALIZED:
40 return "FRAGMENT_FINALIZED";
42 return "SERVER_ERROR";
44 return "INTERNAL_ERROR";
50 NOTIMPLEMENTED() <<
"Unknown Status Code: " << error_code;
51 return "UNKNOWN_STATUS";
57 const Status Status::OK = Status(error::OK,
"");
58 const Status Status::UNKNOWN = Status(error::UNKNOWN,
"");
61 if (error_code_ == error::OK)
64 return base::StringPrintf(
"%d (%s): %s",
66 error::ErrorCodeToString(error_code_).c_str(),
67 error_message_.c_str());
70 std::ostream& operator<<(std::ostream& os,
const Status& x) {