33 lines
817 B
C#
33 lines
817 B
C#
using Microsoft.SharePoint;
|
|
using System;
|
|
namespace SPSolutions.SharePoint.Workflow
|
|
{
|
|
public static class SPWorkflowUtil
|
|
{
|
|
public static string GetErrorMessage(Exception e)
|
|
{
|
|
if (e is SPException)
|
|
{
|
|
return SPWorkflowUtil.GetErrorMessage(e as SPException);
|
|
}
|
|
return SPResource.GetString("WorkflowFailedStartMessage", new object[0]);
|
|
}
|
|
public static string GetErrorMessage(SPException e)
|
|
{
|
|
if (e.ErrorCode == -2130575205)
|
|
{
|
|
return SPResource.GetString("WorkflowFailedAlreadyRunningMessage", new object[0]);
|
|
}
|
|
if (e.ErrorCode == -2130575339)
|
|
{
|
|
return SPResource.GetString("ListVersionMismatch", new object[0]);
|
|
}
|
|
if (e.ErrorCode == -2130575338)
|
|
{
|
|
return e.Message;
|
|
}
|
|
return SPResource.GetString("WorkflowFailedStartMessage", new object[0]);
|
|
}
|
|
}
|
|
}
|