Skip to content

Commit a261604

Browse files
committed
fix(devins-lang): improve error handling for toolchain functions
- Enhance error message with more context and details- Add next code lookup to provide better understanding of the error - Include error
1 parent 7ece9d5 commit a261604

File tree

1 file changed

+4
-1
lines changed
  • exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler

1 file changed

+4
-1
lines changed

exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/DevInsCompiler.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,10 @@ class DevInsCompiler(
372372
} catch (e: Exception) {
373373
logger<DevInsCompiler>().warn(e)
374374
val text = runReadAction { used.text }
375-
val error = "Error executing toolchain function: $text + $prop"
375+
val nextCode = lookupNextCode(used)?.codeText()
376+
val error = "Error executing toolchain function: $text:$prop, $nextCode\n" +
377+
"Error: ${e.message}\n" +
378+
"Please check the command and try again."
376379
AutoDevNotifications.notify(myProject, error)
377380
error
378381
}

0 commit comments

Comments
 (0)