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

Debugging options for exceptions thrown in ASP.Net MVC views

1 Answer 146 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 23 Dec 2012, 08:47 AM
I'm somewhat disappointed by the lack of debugging information given by default for the Kendo Html helpers. The only way I've so far been able to tell what I'm doing wrong with them is with a try-catch, which most people around the web say is poor practice at best. So my question is, is there a better way to catch all errors on the view and log them somehow? Or redirect to  Or a way to do less of the Kendo logic in the view?

As an example, here's what I've come up with for catching errors.

@(
    try {
        @Html(.Kendo().Grid(Model)
            // etc.
        )
    }
    catch(Exception e)
    {
        @Html.Raw("<pre>" + e + "</pre>");
    }
)

Which works for debugging, but is very inelegant. Without this exception catch block, I wind up with a zero-byte response which is just a blank screen.

I realize this problem isn't unique to the Kendo Asp.NET MVC exceptions, but the code used to generate the fancy-ness is quite heavy in terms of syntax and computations. Is there any intrinsic logging or exception handling included with Kendo?

Also, any tips on debugging the client side code would be appreciated. Are un-minified versions of the javascript available? Can you specify the html extension methods to generate line breaks so the widget code is easir to read?

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 25 Dec 2012, 01:45 PM
Hello Eric,

To the questions:

Basically once your Grid is properly configured it should not throw any exceptions at all. Kendo does not provide any intrinsic logging/exception handling feature.

Source files should be available inside of the commercial Kendo UI package .

There is no option to insert break lines could not be automatically after each widget.

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Eric
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or