improve tornado error handling