From 9819adf9d6bf8105dcbb097fc656c97323ee6306 Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Thu, 6 Dec 2018 17:35:53 -0800 Subject: [PATCH] Fix error code message for trick play error Issue #528. Change-Id: Ib0752960db94910038290b235f64b360cd4f2f00 --- packager/status.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packager/status.cc b/packager/status.cc index fd6b1d5915..35080ec634 100644 --- a/packager/status.cc +++ b/packager/status.cc @@ -13,7 +13,7 @@ namespace shaka { namespace error { namespace { -std::string ErrorCodeToString(Code error_code) { +const char* ErrorCodeToString(Code error_code) { switch (error_code) { case OK: return "OK"; @@ -53,10 +53,12 @@ std::string ErrorCodeToString(Code error_code) { return "NOT_FOUND"; case ALREADY_EXISTS: return "ALREADY_EXISTS"; - default: - NOTIMPLEMENTED() << "Unknown Status Code: " << error_code; - return "UNKNOWN_STATUS"; + case TRICK_PLAY_ERROR: + return "TRICK_PLAY_ERROR"; } + + NOTIMPLEMENTED() << "Unknown Status Code: " << error_code; + return "UNKNOWN_STATUS"; } } // namespace } // namespace error @@ -82,9 +84,8 @@ std::string Status::ToString() const { if (error_code_ == error::OK) return "OK"; - return base::StringPrintf("%d (%s): %s", - error_code_, - error::ErrorCodeToString(error_code_).c_str(), + return base::StringPrintf("%d (%s): %s", error_code_, + error::ErrorCodeToString(error_code_), error_message_.c_str()); }