SPException spEx = ex as SPException;
string errorString;
if (spEx != null && spEx.ErrorCode == -2130575205 /* SPErrorCode.TP_E_WORKFLOW_ALREADY_RUNNING */)
errorString = SPResource.GetString(Strings.WorkflowFailedAlreadyRunningMessage);
else if (spEx != null && spEx.ErrorCode == -2130575339 /* SPErrorCode.TP_E_VERSIONCONFLICT */)
errorString = SPResource.GetString(Strings.ListVersionMismatch);
else if (spEx != null && spEx.ErrorCode == -2130575338 /* SPErrorCode.TP_E_LISTITEMDELETED */)
errorString = spEx.Message;
else
errorString = SPResource.GetString(Strings.WorkflowFailedStartMessage);
SPUtility.Redirect("Error.aspx",
SPRedirectFlags.RelativeToLayoutsPage,
HttpContext.Current,
"ErrorText=" + SPHttpUtility.UrlKeyValueEncode(errorString));