Using Sinatra's error block and Sinatra Environment