web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

handle 2-minute limit Timeout exception of Plugin

(0) ShareShare
ReportReport
Posted on by 702

Anyone know how to catch timeout exception in Plugins? I am aware of 2min execution time allocated for each operation. 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at
    RE: handle 2-minute limit Timeout exception of Plugin

    have a look on the below :

    msdn.microsoft.com/.../gg327884.aspx

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: handle 2-minute limit Timeout exception of Plugin

    Hi

    Please refer the below post on how to catch timeout exception.

    www.inogic.com/.../fault-and-exception-handling-in-dynamics-crm-2011

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: handle 2-minute limit Timeout exception of Plugin

    Hi,

    Please look at below MSDN link.

    msdn.microsoft.com/.../gg327884.aspx

    Mansoor

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: handle 2-minute limit Timeout exception of Plugin

    Hi Mihir,

    You can implement below code for this -

                try
                {
                    try
                    {
                        // Your code here 
    
                    }
                    catch (WebException exception)
                    {
                        string str = string.Empty;
                        if (exception.Response != null)
                        {
                            using (StreamReader reader =
                                new StreamReader(exception.Response.GetResponseStream()))
                            {
                                str = reader.ReadToEnd();
                            }
                            exception.Response.Close();
                        }
                        if (exception.Status == WebExceptionStatus.Timeout)
                        {
                            throw new InvalidPluginExecutionException(
                                "The timeout elapsed while attempting to issue the request.", exception);
                        }
                        throw new InvalidPluginExecutionException(String.Format(CultureInfo.InvariantCulture,
                            "A Web exception occurred while attempting to issue the request. {0}: {1}",
                            exception.Message, str), exception);
                    }
                }
                catch (Exception e)
                {
                    tracingService.Trace("Exception: {0}", e.ToString());
                    throw;
                }


    You can also refer below msdn reference .

    msdn.microsoft.com/.../gg509030.aspx

    Hope this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans