Skip to content

Commit 0fab4b6

Browse files
committed
fix(observer): handle build failure notification #259
Add logic to send error notification when build fails with exit code 1 and contains "BUILD FAILED" message.
1 parent b9978c0 commit 0fab4b6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/src/main/kotlin/cc/unitmesh/devti/observer/BuiltTaskAgentObserver.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ class BuiltTaskAgentObserver : AgentObserver, Disposable {
4848
return
4949
}
5050

51+
if (exitCode == 1 && globalBuffer.contains("BUILD FAILED")) {
52+
val prompt = "Help Me fix follow build issue:\n```bash\n$globalBuffer\n```\n"
53+
sendErrorNotification(project, prompt)
54+
return
55+
}
56+
5157
val isSpringFailureToStart =
5258
globalBuffer.contains("***************************") && globalBuffer.contains("APPLICATION FAILED TO START")
5359
if (isSpringFailureToStart) {

0 commit comments

Comments
 (0)