Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): clarify source control errors for unknown providers #11131

ClosedGuria(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/11131/headopened View on GitHub

Showing 3 changed files with 21 additions and 8 deletions.

x
0 of 3 viewed, 3 left
5 additions and 0 deletionsapps/server/src/sourceControl/SourceControlProviderRegistry.test.tsModified
View file
@@ -142,6 +142,11 @@
assert.strictEqual(error.operation, "getChangeRequest");
assert.strictEqual(error.cwd, "/repo");
assert.strictEqual(error.reference, "#42");
+ assert.strictEqual(error.detail, "No source control provider was detected for this project.");
+ assert.strictEqual(
+ error.message,
+ "Source control getChangeRequest failed: No source control provider was detected for this project.",
+ );
}),
​
13 additions and 7 deletionsapps/server/src/sourceControl/SourceControlProviderRegistry.tsModified
View file
@@ -64,6 +64,12 @@
>()("t3/sourceControl/SourceControlProviderRegistry") {}
​
+function unsupportedProviderDetail(kind: SourceControlProviderKind): string {
+ return kind === "unknown"
+ ? "No source control provider was detected for this project."
+ : `No ${kind} source control provider is registered.`;
Resolvedby Guria(GitHub profile, opens in a new tab)
+}
+​
function unsupportedProvider(
kind: SourceControlProviderKind,
): SourceControlProvider.SourceControlProvider["Service"] {