Error from Web Service unable to catch

4 posts, 0 answers
  1. Peali
    Peali avatar
    3 posts
    Member since:
    Jul 2012

    Posted 27 Jun 2012 Link to this post

    I am using the RadSchedular for our application. All the data are coming,saving and updating through Web service which the Telerik project provided. I only changed the business logic in the MyDbSchedulerProvider class to get and save data from our database. There are lots of cases when service side error can occur. However I am unable to throw the error from web method to the Schedular pages . Can anyone please help me in this regard?
  2. Plamen
    Admin
    Plamen avatar
    2958 posts

    Posted 28 Jun 2012 Link to this post

    Hi Peali, 

    I am attaching a sample case where is thrown custom new exception in the GetAppointments of MyDbSchedulerProvider so if an error occurs it can be handled and changed after that.

    Hope this will be helpful. If you are trying to achieve something different please elaborate a little bit the exact scenario you are trying to implement.

    Greetings,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Peali
    Peali avatar
    3 posts
    Member since:
    Jul 2012

    Posted 11 Jul 2012 Link to this post

    Hi Plamen,

    Thanks for your reply. I can see the code for throwing the custom exception
    throw new Exception("New Exception");

    Now I want to show this error message on the screen to the user. What will be the code for that?
  4. Plamen
    Admin
    Plamen avatar
    2958 posts

    Posted 16 Jul 2012 Link to this post

    Hello Peali,

     
    Here is one way to show the error message on the screen of the user:

    Exception ex = new Exception();
               try
               {
                   throw ex;
               }
               catch (Exception)
               {
     
                   throw new ArgumentException("Now I want to show this error message on the screen to the user....");
               }

    You can also refer to this article where is explained how to write a custom ASP.NET trace message.

    Hope this will be helpful.

    Greetings,
    Plamen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top