Search⌘ K

Managing Routing Issues for Nonexistent Contacts

Understand how to manage routing issues in Marionette by implementing error handling for URLs referencing nonexistent contacts. Learn to create a new template and view for error messages and update the showContact function to enhance user experience when invalid contact routes are accessed.

Now that we have routing implemented, we need to manage routing issues. Notably, displaying an error message when a user loads the URL for a nonexistent contact, e.g., #contacts/999 or #contacts/foo. Right now, our app will display a blank page, which isn’t very helpful. ...