Skip to content
Snippets Groups Projects
Commit ee8bf048 authored by Andre Maroneze's avatar Andre Maroneze
Browse files

[Server] fail more gracefully with invalid JSON files

parent 38296d70
No related branches found
No related tags found
No related merge requests found
...@@ -102,7 +102,13 @@ let execute () = ...@@ -102,7 +102,13 @@ let execute () =
List.iter List.iter
begin fun file -> begin fun file ->
Senv.feedback "Script %S" file ; Senv.feedback "Script %S" file ;
let response = execute_batch (Js.from_file file) in let response =
try
execute_batch (Js.from_file file)
with Yojson.Json_error msg ->
Senv.error "[batch] error in JSON file:@\n%s@." msg;
`Null
in
let output = Filename.remove_extension file ^ ".out.json" in let output = Filename.remove_extension file ^ ".out.json" in
let output = match BatchOutputDir.get () with let output = match BatchOutputDir.get () with
| "" -> output | "" -> output
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment