libraries/iosrv/client/command_base.cpp
changeset 6 96d581d2147d
parent 0 7f656887cf89
child 23 092bcc217d9d
--- a/libraries/iosrv/client/command_base.cpp	Wed Jul 07 16:07:08 2010 +0100
+++ b/libraries/iosrv/client/command_base.cpp	Fri Jul 09 10:11:55 2010 +0100
@@ -3067,7 +3067,12 @@
 	TOverflowTruncate overflow;
 	aDes = _L("Error: ");
 	aDes.AppendFormatList(aFmt, aList, &overflow);
-	aDes.AppendFormat(_L(" : %S (%d)\r\n"), &overflow, Stringify::Error(aError), aError);
+	const TDesC* errorDesc = NULL;
+	// See if we have an extension that knows about this error
+	if (iExtension) errorDesc = iExtension->StringifyError(aError);
+	// If the extension didn't know, fall back to Stringify::Error() to handle the system ones
+	if (errorDesc == NULL) errorDesc = Stringify::Error(aError);
+	aDes.AppendFormat(_L(" : %S (%d)\r\n"), &overflow, errorDesc, aError);
 	}
 
 void CCommandBase::FormatWarningText(TDes& aDes, TRefByValue<const TDesC> aFmt, VA_LIST& aList) const
@@ -3835,4 +3840,19 @@
 	iReadHandle.CancelNotifyChange();
 	}
 
-	
+// 
+
+EXPORT_C TCommandExtensionVersion MCommandExtensionsV1::ExtensionVersion() const
+	{
+	return ECommandExtensionV1;
+	}
+
+EXPORT_C const TDesC* MCommandExtensionsV1::StringifyError(TInt /*aError*/) const
+	{
+	return NULL; // By default we don't have anything additional
+	}
+
+EXPORT_C void CCommandBase::SetExtension(MCommandExtensionsV1* aExtension)
+	{
+	iExtension = aExtension;
+	}