Use the env module to catch errors in the dispatcher.