Skip to content

Commit c225e03

Browse files
committed
fix(compiler): return null instead of error message for missing file
Simplify error handling in FileInsCommand by returning null when a file is not found, instead of a string error message. This aligns with the expected behavior of the command execution.
1 parent a17ab78 commit c225e03

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ class FileInsCommand(private val myProject: Project, private val prop: String) :
3434
val contentsToByteArray = virtualFile?.contentsToByteArray()
3535
if (contentsToByteArray == null) {
3636
AutoDevNotifications.warn(myProject, "File not found: $prop")
37-
return null
37+
/// not show error message to just notify
38+
return "File not found: $prop"
3839
}
3940

4041
InsCommandListener.notify(this, InsCommandStatus.SUCCESS, virtualFile)

0 commit comments

Comments
 (0)