Contributing Quick Fixes
Support for writing custom quick fixes has been discontinued. Feel free to reach out if you have ideas for new quick fixes.
You have probably seen the new Fix tab on elmah.io. If not, check out the We don't just log your errors. We help you fix them! blog post. The Fix tab helps you fix errors fast, by providing quick fixes known from Visual Studio and relevant answers from Stack Overflow. The number of quick fixes are still limited, but that's something we want to change. We constantly look through the errors in our own logs and evaluate if any of those errors could need a quick fix.
Chances are that you experience other errors than we do. With the recent release on elmah.io, we support custom quick fixes through the new Elmah.Io.QuickFixes
(no longer available) repository on GitHub. By forking this repository, you will be able to create custom quick fixes, which will show up in the elmah.io UI.
Creating a new quick fix requires nothing more than a bit of C#:
public class ImATeapotDocumentationQuickFix : QuickFixBase
{
public ImATeapotDocumentationQuickFix()
{
Icon = "fa-coffee";
Url = new Uri("https://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol");
Text = "One does not simply brew a cup of tea";
}
public override bool CanFix(Message message)
{
return message.StatusCode.HasValue && message.StatusCode.Value == 418;
}
}
In this example, we create a new quick fix with a link to the Coffee Pot Control Protocol on Wikipedia on all errors with a status code of 418
.
To get started creating quick fixes for elmah.io, fork the Elmah.Io.QuickFixes
(no longer available) repository and add a new C# class. Additional documentation and examples are available in the repository as well.