Catching bad request exception