From 13964b9f7f2de228aac7966d1bf8d976eea78d83 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 12 Jul 2026 16:07:28 +0100 Subject: [PATCH] org: show full error details in development --- src/Yavsc.Org/Views/Shared/Error.cshtml | 39 +++++++++++++++++++++---- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/src/Yavsc.Org/Views/Shared/Error.cshtml b/src/Yavsc.Org/Views/Shared/Error.cshtml index ed29d328..49c7539f 100644 --- a/src/Yavsc.Org/Views/Shared/Error.cshtml +++ b/src/Yavsc.Org/Views/Shared/Error.cshtml @@ -1,14 +1,41 @@ -@model ErrorViewModel +@using Microsoft.AspNetCore.Hosting +@using Yavsc.Models +@inject IWebHostEnvironment Env +@model object @{ ViewBag.Title = "Error"; }

Error.

-

An error occurred while processing your request.

-@if (Model!=null) if (Model.ShowRequestId) +@if (Env.IsDevelopment()) { -

- Request ID: @Model.RequestId -

+

An unhandled exception occurred while processing your request.

+ if (Model is Exception exception) + { +
@exception.ToString()
+ } + else if (Model is ErrorViewModel errorViewModel && !string.IsNullOrWhiteSpace(errorViewModel.Description)) + { +
@errorViewModel.Description
+ } +} +else +{ +

An error occurred while processing your request.

+ + if (Model is ErrorViewModel errorViewModel) + { + if (errorViewModel.ShowRequestId) + { +

+ Request ID: @errorViewModel.RequestId +

+ } + + if (!string.IsNullOrWhiteSpace(errorViewModel.Description)) + { +

@errorViewModel.Description

+ } + } }