7 #include "packager/media/base/status.h"
9 #include "packager/base/strings/stringprintf.h"
11 namespace edash_packager {
16 std::string ErrorCodeToString(Code error_code) {
24 case INVALID_ARGUMENT:
25 return "INVALID_ARGUMENT";
27 return "UNIMPLEMENTED";
29 return "FILE_FAILURE";
31 return "END_OF_STREAM";
33 return "HTTP_FAILURE";
35 return "PARSER_FAILURE";
37 return "MUXER_FAILURE";
38 case FRAGMENT_FINALIZED:
39 return "FRAGMENT_FINALIZED";
41 return "SERVER_ERROR";
43 return "INTERNAL_ERROR";
49 NOTIMPLEMENTED() <<
"Unknown Status Code: " << error_code;
50 return "UNKNOWN_STATUS";
56 const Status& Status::OK = Status(error::OK,
"");
57 const Status& Status::UNKNOWN = Status(error::UNKNOWN,
"");
60 if (error_code_ == error::OK)
63 return base::StringPrintf(
"%d (%s): %s",
65 error::ErrorCodeToString(error_code_).c_str(),
66 error_message_.c_str());
69 std::ostream& operator<<(std::ostream& os,
const Status& x) {