src/Palete/ValaCompileRequest.vala
authorAlan <alan@roojs.com>
Fri, 9 Feb 2024 06:13:39 +0000 (14:13 +0800)
committerAlan <alan@roojs.com>
Fri, 9 Feb 2024 06:13:39 +0000 (14:13 +0800)
src/Palete/ValaCompileRequest.vala

index aa9b50a..6b3a956 100644 (file)
@@ -67,7 +67,11 @@ namespace Palete {
                        var exe = GLib.Environment.find_program_in_path( "meson");
                        string[] args = { exe ,"setup", "build", "--prefix=/usr" };             
                        GLib.debug("running meson");
-                       this.spawn = new Spawn(this.project.path , args);
+                       try {
+                               this.spawn = new Spawn(this.project.path , args);
+                       } catch (GLib.Error e) {
+                               return -1;
+                       }
                        this.spawn.output_line.connect(( str) => {
                                this.onOutput(str);
                        });
@@ -83,8 +87,11 @@ namespace Palete {
                        }
                        var exe = GLib.Environment.find_program_in_path( "ninja");
                        string[] args = { exe };                
-
-                       this.spawn = new Spawn(this.project.path + "/build" , args);
+                       try {
+                               this.spawn = new Spawn(this.project.path + "/build" , args);
+                       } catch (GLib.Error) {
+                               return -1;
+                       )
                        this.spawn.output_line.connect(( str) => {
                                this.onOutput(str);
                        });