From: Tomasz Marciniak Date: Mon, 19 Oct 2015 08:49:11 +0000 (+0200) Subject: [Content[ Changed error handling. X-Git-Tag: submit/tizen/20151026.073646^2^2~9^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d8686f16905ccd06f326eb49af05b984b076c4d;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Content[ Changed error handling. [Features] Commit migrated from tv branch. http://165.213.149.170/gerrit/#/c/77614/ [Verification] Code compiles. TCT 100% Change-Id: I77becf36c3d4609c1e9cca8464f4680a138a2bea Signed-off-by: Tomasz Marciniak --- diff --git a/src/content/content_manager.cc b/src/content/content_manager.cc index 6e1f0f2f..491abb89 100755 --- a/src/content/content_manager.cc +++ b/src/content/content_manager.cc @@ -1551,25 +1551,26 @@ int ContentManager::getNumberOfTracks(int id, int* result) { } PlatformResult ContentManager::convertError(int err) { + char* error_msg = get_error_message(err); switch (err) { case MEDIA_CONTENT_ERROR_INVALID_PARAMETER : - return PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid parameter."); + return PlatformResult(ErrorCode::INVALID_VALUES_ERR, error_msg); case MEDIA_CONTENT_ERROR_OUT_OF_MEMORY : - return PlatformResult(ErrorCode::UNKNOWN_ERR, "Out of memory."); + return PlatformResult(ErrorCode::UNKNOWN_ERR, error_msg); case MEDIA_CONTENT_ERROR_INVALID_OPERATION : - return PlatformResult(ErrorCode::UNKNOWN_ERR, "Invalid Operation."); + return PlatformResult(ErrorCode::UNKNOWN_ERR, error_msg); case MEDIA_CONTENT_FILE_NO_SPACE_ON_DEVICE : - return PlatformResult(ErrorCode::UNKNOWN_ERR, "No space left on device."); + return PlatformResult(ErrorCode::UNKNOWN_ERR, error_msg); case MEDIA_CONTENT_ERROR_PERMISSION_DENIED : - return PlatformResult(ErrorCode::UNKNOWN_ERR, "Permission denied."); + return PlatformResult(ErrorCode::UNKNOWN_ERR, error_msg); case MEDIA_CONTENT_ERROR_DB_FAILED : - return PlatformResult(ErrorCode::UNKNOWN_ERR, "DB operation failed."); + return PlatformResult(ErrorCode::UNKNOWN_ERR, error_msg); case MEDIA_CONTENT_ERROR_DB_BUSY : - return PlatformResult(ErrorCode::UNKNOWN_ERR, "DB operation BUSY."); + return PlatformResult(ErrorCode::UNKNOWN_ERR, error_msg); case MEDIA_CONTENT_ERROR_NETWORK : - return PlatformResult(ErrorCode::UNKNOWN_ERR, "Network Fail."); + return PlatformResult(ErrorCode::UNKNOWN_ERR, error_msg); case MEDIA_CONTENT_ERROR_UNSUPPORTED_CONTENT : - return PlatformResult(ErrorCode::UNKNOWN_ERR, "Unsupported Content."); + return PlatformResult(ErrorCode::UNKNOWN_ERR, error_msg); default: return PlatformResult(ErrorCode::UNKNOWN_ERR, "Unknown error."); }