I have an existing error exception handler
protected override async Task OnPageExceptionAsync(IDotvvmRequestContext context, Exception exception)
{
context.IsCommandExceptionHandled = true;
if (exception is InvalidRouteException)
{
var baseException = exception as InvalidRouteException;
context.RedirectToUrl("/Dashboard?ErrorMessage=InvalidUrl");
}
else if (exception is ForbiddenException)
{
var baseException = exception as ForbiddenException;
context.RedirectToUrl("/Dashboard?ErrorMessage=Forbidden");
}
//or reroute back to previous url
//var masterViewModel = context.ViewModel as MasterLayoutViewModel;
//context.RedirectToUrl(masterViewModel.postbackurl);
context.RedirectToRoute("Error", query: new { message = Constants.Error.ErrorMessage });
await base.OnPageExceptionAsync(context, exception);
}
now, how can I write the error details to ELMAH manually?