class Errors::Show

Overview

This class handles error responses and reporting.

https://luckyframework.org/guides/http-and-routing/error-handling

Included Modules

Defined in:

actions/errors/show.cr

Constant Summary

DEFAULT_MESSAGE = "Something went wrong."
EXPOSURES = [] of Symbol

This class handles error responses and reporting.

https://luckyframework.org/guides/http-and-routing/error-handling

Instance Method Summary

Instance Method Detail

def _dont_report #

[View source]
def default_render(error : Exception) : Lucky::Response #

If none of the 'render' methods return a response for the raised Exception, Lucky will use this method.


[View source]
def render(error : Lucky::RouteNotFoundError | Avram::RecordNotFoundError) #

[View source]
def render(error : Avram::InvalidOperationError) #

When the request is JSON and an InvalidOperationError is raised, show a helpful error with the param that is invalid, and what was wrong with it.


[View source]
def render(error : Lucky::RenderableError) #

Always keep this below other 'render' methods or it may override your custom 'render' methods.


[View source]