Skip to content

Commit 3305c68

Browse files
committed
Added info of reason for commit failed (Close #236)
1 parent f8d4da0 commit 3305c68

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export class SvnCommands implements IDisposable {
183183
repository.inputBox.value = "";
184184
} catch (error) {
185185
console.error(error);
186-
window.showErrorMessage("Unable to commit");
186+
window.showErrorMessage(error.stderrFormated);
187187
}
188188
}
189189

@@ -324,7 +324,7 @@ export class SvnCommands implements IDisposable {
324324
repository.inputBox.value = "";
325325
} catch (error) {
326326
console.error(error);
327-
window.showErrorMessage("Unable to commit");
327+
window.showErrorMessage(error.stderrFormated);
328328
}
329329
});
330330
}

src/svn.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export interface ISvnErrorData {
7373
message?: string;
7474
stdout?: string;
7575
stderr?: string;
76+
stderrFormated?: string;
7677
exitCode?: number;
7778
svnErrorCode?: string;
7879
svnCommand?: string;
@@ -110,6 +111,7 @@ export class SvnError {
110111
message: string;
111112
stdout?: string;
112113
stderr?: string;
114+
stderrFormated?: string;
113115
exitCode?: number;
114116
svnErrorCode?: string;
115117
svnCommand?: string;
@@ -125,6 +127,7 @@ export class SvnError {
125127
this.message = data.message || "SVN error";
126128
this.stdout = data.stdout;
127129
this.stderr = data.stderr;
130+
this.stderrFormated = data.stderrFormated;
128131
this.exitCode = data.exitCode;
129132
this.svnErrorCode = data.svnErrorCode;
130133
this.svnCommand = data.svnCommand;
@@ -281,6 +284,7 @@ export class Svn {
281284
message: "Failed to execute svn",
282285
stdout: stdout,
283286
stderr: stderr,
287+
stderrFormated: stderr.replace(/^svn: E\d+: +/gm, ""),
284288
exitCode: exitCode,
285289
svnErrorCode: getSvnErrorCode(stderr),
286290
svnCommand: args[0]

0 commit comments

Comments
 (0)