Dictionary Lookup
| I |
error_messages = {
'no_perms' : ("No Permissions","You have no permissions for this page"),
'no_crse' : ("No course", "There is no course with specified course number")
}
Then when raising the exception you do a
raise WebError ("no_perms{}")
The "{}" at the end of the error string, instructs the handler to do a dictionary lookup and call generate_error_page with the two strings defined in the dictionary. The second argument is ignored in this case. If the specified dictionary entry does not exist, it generates a default error message to the user as well as an error message to the debug.log file.

