application/src/PodcastAppui.cpp
changeset 82 d87e984bd8b8
parent 71 4d1286f7f982
child 84 3b59b88b089e
--- a/application/src/PodcastAppui.cpp	Sun Apr 04 18:52:11 2010 +0100
+++ b/application/src/PodcastAppui.cpp	Sun Apr 04 21:47:56 2010 +0100
@@ -343,3 +343,47 @@
 	iQueueView->UpdateToolbar(ETrue);
 	iSearchView->UpdateToolbar(ETrue);
 	}
+
+void CPodcastAppUi::GetErrorText(TDes &aErrorMessage, TInt aErrorCode)
+	{
+	switch (aErrorCode)
+		{
+		case KErrNotFound:
+			{
+			HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_INVALID_ADDRESS);
+			aErrorMessage.Copy(*error);
+			CleanupStack::PopAndDestroy(error);
+			}
+			break;
+		case KErrDiskFull:
+			{
+			HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_DISK_FULL);
+			aErrorMessage.Copy(*error);
+			CleanupStack::PopAndDestroy(error);
+			}
+			break;
+		case 404:
+			{
+			HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_NOTFOUND);
+			aErrorMessage.Copy(*error);
+			CleanupStack::PopAndDestroy(error);
+			}
+			break;
+		default:
+			{
+			if (aErrorCode > 200)
+				{
+				HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_HTTP);
+				aErrorMessage.Format(*error, aErrorCode);
+				CleanupStack::PopAndDestroy(error);
+				}
+			else
+				{
+				HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_GENERAL);
+				aErrorMessage.Format(*error, aErrorCode);
+				CleanupStack::PopAndDestroy(error);
+				}
+			}
+			break;
+		}
+	}