Use SPL exceptions. Add a page which lists all examples.