mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-30 01:17:37 +03:00
Merge pull request #1866 from gitbutlerapp/handle-fetch-errors
Handle fetch errors
This commit is contained in:
commit
0bed078a09
@ -96,8 +96,13 @@ impl HandlerInner {
|
||||
|
||||
let fetch_result = match backoff::retry(policy, || {
|
||||
gb_repo.fetch(user.as_ref()).map_err(|err| {
|
||||
tracing::warn!(%project_id, ?err, will_retry=true, "failed to fetch gitbutler data" );
|
||||
backoff::Error::transient(err)
|
||||
match err {
|
||||
gb_repository::RemoteError::Network => backoff::Error::permanent(err),
|
||||
err => {
|
||||
tracing::warn!(%project_id, ?err, will_retry = true, "failed to fetch project data");
|
||||
backoff::Error::transient(err)
|
||||
}
|
||||
}
|
||||
})
|
||||
}) {
|
||||
Ok(()) => projects::FetchResult::Fetched { timestamp: *now },
|
||||
|
@ -105,8 +105,13 @@ impl HandlerInner {
|
||||
project_repository
|
||||
.fetch(default_target.branch.remote(), &credentials)
|
||||
.map_err(|err| {
|
||||
tracing::warn!(%project_id, ?err, will_retry = true, "failed to fetch project data");
|
||||
backoff::Error::transient(err)
|
||||
match err {
|
||||
RemoteError::Auth | RemoteError::Network => backoff::Error::permanent(err),
|
||||
err => {
|
||||
tracing::warn!(%project_id, ?err, will_retry = true, "failed to fetch project data");
|
||||
backoff::Error::transient(err)
|
||||
}
|
||||
}
|
||||
})
|
||||
}) {
|
||||
Ok(()) => projects::FetchResult::Fetched { timestamp: *now },
|
||||
|
Loading…
Reference in New Issue
Block a user