PandaWood / ExceptionReporter.NET

ExceptionReporter is a .NET component that gathers detailed information on an Exception and the application/system running it. It allows the user to copy, save or send a custom-formatted report to the developer
MIT License
51 stars 32 forks source link

Feature Request: Custom Reporter Form #14

Closed MattMoradi closed 6 years ago

MattMoradi commented 6 years ago

I was wondering if there are any plans to include an API to allow implementation of a custom reporter form to match the styling and theme of my application. Just so developers like myself can implement their own custom crash report dialog prompts so that they can maintain look and feel for their entire application similarly.

I see you already have some customization options on the existing reporter forms which is great, but will you be implementing the ability for me to utilize my own custom crash reporter forms instead of your pre-designed ones?

PandaWood commented 6 years ago

Hi @matthew17754 Actually there is an API that will kind of allow you to do this. The ExceptionReportGenerator class can be used without showing any dialog.

If you create an instance of this class it can generate the same textual report. And you can also send it via email, without showing any dialog.

It's not quite perfect for your situation, though, because the ExceptionReport class returned only has a ToString() on it.

We should modify this return value to an object with all the various properties on it, so you can access them for your own dialog. eg Exceptions/SystemInfo etc

MattMoradi commented 6 years ago

Thank you @PandaWood I'll be sure to check it out. In that case, feel free to close this issue once the object return type has been fully implemented.

PandaWood commented 6 years ago

I've made a small change - on the master branch - for this (see issue link above). I added 2 new properties on the ExceptionReport object that is returned: ReportInfo and IList<SysInfoResults> - that covers all info, I think, that's in the report. Still not in perfectly accessible format but close.

I need to fix a few more issues before releasing this as an update on NuGet, though.

PandaWood commented 6 years ago

The extended properties on the ExceptionReport object (returned from ExceptionReportGenerator) are in latest nuget release 2.4.1

PandaWood commented 6 years ago

I think a better solution for this problem has come about recently. Though I haven't fully tested it

But there is a way to implement your own dialog for ExceptionReporter.NET by implementing

This technique is what is used by tests where the IViewMaker is mocked out. In exactly the same way, you can replace the current view with another. This should also set us up for a WPF version of the view as well. I just need to battle-test this idea and find out if there's any issues interacting with the supplied ExceptionReportPresenter - which you'd need to call to be able to implement ExceptionReporter functionality