[HttpKernel] fix usage of deprecated FlattenException