From 0aa475b336840fb86b550a0fab7c4f5cc82875b5 Mon Sep 17 00:00:00 2001 From: Elmar Jansen Date: Sat, 4 Nov 2023 17:48:12 +0100 Subject: [PATCH 1/2] Corrected spelling (and casing) of error messages --- src/GitHubExtension/Providers/RepositoryProvider.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GitHubExtension/Providers/RepositoryProvider.cs b/src/GitHubExtension/Providers/RepositoryProvider.cs index 8c929a42..8d5caa8b 100644 --- a/src/GitHubExtension/Providers/RepositoryProvider.cs +++ b/src/GitHubExtension/Providers/RepositoryProvider.cs @@ -229,7 +229,7 @@ public IAsyncOperation CloneRepositoryAsync(IRepository catch (LibGit2Sharp.UserCancelledException userCancelledException) { Providers.Log.Logger()?.ReportError("DevHomeRepository", "The user stoped the clone operation", userCancelledException); - return new ProviderOperationResult(ProviderOperationStatus.Failure, userCancelledException, "User cancalled the operation", userCancelledException.Message); + return new ProviderOperationResult(ProviderOperationStatus.Failure, userCancelledException, "User cancelled the operation", userCancelledException.Message); } catch (LibGit2Sharp.NameConflictException nameConflictException) { @@ -239,12 +239,12 @@ public IAsyncOperation CloneRepositoryAsync(IRepository catch (LibGit2Sharp.LibGit2SharpException libGitTwoException) { Providers.Log.Logger()?.ReportError("DevHomeRepository", $"Either no logged in account has access to this repo, or the repo can't be found", libGitTwoException); - return new ProviderOperationResult(ProviderOperationStatus.Failure, libGitTwoException, "LigGit2 threw an exception", "LibGit2 Threw an exception"); + return new ProviderOperationResult(ProviderOperationStatus.Failure, libGitTwoException, "LibGit2 threw an exception", "LibGit2 threw an exception"); } catch (Exception e) { Providers.Log.Logger()?.ReportError("DevHomeRepository", "Could not clone the repository", e); - return new ProviderOperationResult(ProviderOperationStatus.Failure, e, "Something happened when cloning the repo", "something happened when cloning the repo"); + return new ProviderOperationResult(ProviderOperationStatus.Failure, e, "Something happened when cloning the repo", "Something happened when cloning the repo"); } return new ProviderOperationResult(ProviderOperationStatus.Success, new ArgumentException("Nothing wrong"), "Nothing wrong", "Nothing wrong"); From ff93189c660780b53cba6989dd2469b0a150b057 Mon Sep 17 00:00:00 2001 From: Elmar Jansen Date: Mon, 6 Nov 2023 21:57:45 +0100 Subject: [PATCH 2/2] Additional corrections to exception messages --- .../Providers/RepositoryProvider.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/GitHubExtension/Providers/RepositoryProvider.cs b/src/GitHubExtension/Providers/RepositoryProvider.cs index 8d5caa8b..2ff8e6cb 100644 --- a/src/GitHubExtension/Providers/RepositoryProvider.cs +++ b/src/GitHubExtension/Providers/RepositoryProvider.cs @@ -223,28 +223,28 @@ public IAsyncOperation CloneRepositoryAsync(IRepository } catch (LibGit2Sharp.RecurseSubmodulesException recurseException) { - Providers.Log.Logger()?.ReportError("DevHomeRepository", "Could not clone all sub modules", recurseException); - return new ProviderOperationResult(ProviderOperationStatus.Failure, recurseException, "Could not clone all modules", recurseException.Message); + Providers.Log.Logger()?.ReportError("DevHomeRepository", "Could not clone all submodules.", recurseException); + return new ProviderOperationResult(ProviderOperationStatus.Failure, recurseException, "Could not clone all submodules.", recurseException.Message); } catch (LibGit2Sharp.UserCancelledException userCancelledException) { - Providers.Log.Logger()?.ReportError("DevHomeRepository", "The user stoped the clone operation", userCancelledException); - return new ProviderOperationResult(ProviderOperationStatus.Failure, userCancelledException, "User cancelled the operation", userCancelledException.Message); + Providers.Log.Logger()?.ReportError("DevHomeRepository", "The user stopped the clone operation.", userCancelledException); + return new ProviderOperationResult(ProviderOperationStatus.Failure, userCancelledException, "User cancelled the clone operation.", userCancelledException.Message); } catch (LibGit2Sharp.NameConflictException nameConflictException) { Providers.Log.Logger()?.ReportError("DevHomeRepository", nameConflictException); - return new ProviderOperationResult(ProviderOperationStatus.Failure, nameConflictException, "The location exists and is non-empty", nameConflictException.Message); + return new ProviderOperationResult(ProviderOperationStatus.Failure, nameConflictException, "The destination location is non-empty.", nameConflictException.Message); } catch (LibGit2Sharp.LibGit2SharpException libGitTwoException) { - Providers.Log.Logger()?.ReportError("DevHomeRepository", $"Either no logged in account has access to this repo, or the repo can't be found", libGitTwoException); - return new ProviderOperationResult(ProviderOperationStatus.Failure, libGitTwoException, "LibGit2 threw an exception", "LibGit2 threw an exception"); + Providers.Log.Logger()?.ReportError("DevHomeRepository", $"Either no logged in account has access to this repository, or the repository can't be found.", libGitTwoException); + return new ProviderOperationResult(ProviderOperationStatus.Failure, libGitTwoException, "LibGit2 library threw an exception.", "LibGit2 library threw an exception."); } catch (Exception e) { - Providers.Log.Logger()?.ReportError("DevHomeRepository", "Could not clone the repository", e); - return new ProviderOperationResult(ProviderOperationStatus.Failure, e, "Something happened when cloning the repo", "Something happened when cloning the repo"); + Providers.Log.Logger()?.ReportError("DevHomeRepository", "Could not clone the repository.", e); + return new ProviderOperationResult(ProviderOperationStatus.Failure, e, "Something happened when cloning the repository.", "Something happened when cloning the repository."); } return new ProviderOperationResult(ProviderOperationStatus.Success, new ArgumentException("Nothing wrong"), "Nothing wrong", "Nothing wrong");