Browse Source

disable resume error when @:build fails (fixed issue #1362)

Nicolas Cannasse 12 years ago
parent
commit
02e88c8c6a
1 changed files with 3 additions and 5 deletions
  1. 3 5
      typeload.ml

+ 3 - 5
typeload.ml

@@ -971,7 +971,7 @@ let build_module_def ctx mt meta fvars context_init fbuild =
 				| _ -> error "Invalid build parameters" p
 			) in
 			let s = try String.concat "." (List.rev (string_list_of_expr_path epath)) with Error (_,p) -> error "Build call parameter must be a class path" p in
-			if ctx.in_macro then error "You cannot used :build inside a macro : make sure that your enum is not used in macro" p;
+			if ctx.in_macro then error "You cannot use @:build inside a macro : make sure that your enum is not used in macro" p;
 			let old = ctx.g.get_build_infos in
 			ctx.g.get_build_infos <- (fun() -> Some (mt, fvars()));
 			context_init();
@@ -983,10 +983,8 @@ let build_module_def ctx mt meta fvars context_init fbuild =
 		| _ :: l -> loop l
 		| [] -> ()
 	in
-	try
-		loop meta
-	with Error (Custom msg,p) ->
-		display_error ctx msg p
+	(* let errors go through to prevent resume if build fails *)
+	loop meta
 
 let init_class ctx c p context_init herits fields =
 	let ctx = {