Browse Source

[eval] better error reporting on sys.io.File being unable to write to a file

Alexander Kuzmenko 6 years ago
parent
commit
175d06b422
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/macro/eval/evalStdLib.ml

+ 5 - 5
src/macro/eval/evalStdLib.ml

@@ -973,12 +973,12 @@ module StdFile = struct
 
 
 	let write_out path content =
 	let write_out path content =
 		try
 		try
-	  		let ch = open_out_bin path in
-  			output_string ch content;
-  			close_out ch;
+			let ch = open_out_bin path in
+			output_string ch content;
+			close_out ch;
 			vnull
 			vnull
-		with Sys_error _ ->
-			exc_string ("Could not write file " ^ path)
+		with Sys_error s ->
+			exc_string s
 
 
 	let append = vfun2 (fun path binary ->
 	let append = vfun2 (fun path binary ->
 		create_out path binary [Open_append]
 		create_out path binary [Open_append]