add rack middleware for reporting exceptions