Catching exception in getting file mime type