Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 855 Bytes

errorHandling.md

File metadata and controls

23 lines (16 loc) · 855 Bytes

Adding Errors in the Handler

Adding errors in the handler is easy. Just add a parameter in the handle method signature with a type of RequestMessages like:

public Object handle(Location location, RequestMessages messages)

Showing the Errors

Of course, you can show these messages however you want. The RequestMessages object is available in the location by the name "messages".

If you're using the oak standard templates (ivy dep ) you can just call a template to show all the errors like:

::messages

This template shows the messages as one div per message where the div has the classes alert and alert-error/alert-info etc. These classes are also used by Bootstrap to format alert areas.