Refresh bucket on connection error

1. Call bucket.Refresh() on connection error
2. Export bucket refresh function