This is a migrated thread and some comments may be shown as answers.

Error from Web Service unable to catch

3 Answers 26 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Peali
Top achievements
Rank 1
Peali asked on 27 Jun 2012, 11:02 AM
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?

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 28 Jun 2012, 02:21 PM
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.
0
Peali
Top achievements
Rank 1
answered on 11 Jul 2012, 08:07 AM
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?
0
Plamen
Telerik team
answered on 16 Jul 2012, 05:53 AM
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.
Tags
Scheduler
Asked by
Peali
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Peali
Top achievements
Rank 1
Share this question
or