WebPresenter.presentExceptionAsHtml

If you override this, you will need to cast the exception type t dynamically, but can then use the template arguments here to refer back to the function.

func is an alias to the method itself, and dg is a callable delegate to the same method on the live object. You could, in theory, change arguments and retry, but I provide that information mostly with the expectation that you will use them to make useful forms or richer error messages for the user.

class WebPresenter(CRTP)
void
presentExceptionAsHtml
(
Meta
)
(,
Throwable t
,
Meta meta
)

Meta

History

BREAKING CHANGE on January 23, 2023 (v11.0 ): it previously took an alias func and T dg to call the function again. I removed this in favor of a Meta param.

Before: void presentExceptionAsHtml(alias func, T)(Cgi cgi, Throwable t, T dg)

After: void presentExceptionAsHtml(Meta)(Cgi cgi, Throwable t, Meta meta)

If you used the func for something, move that something into your methodMeta template.

What is the benefit of this change? Somewhat smaller executables and faster builds thanks to more reused functions, together with enabling an easier implementation of presentExceptionalReturn.