Skip to content

Commit bdcee74

Browse files
authored
Merge pull request #85 from ocaml-ppx/ps/rr/refactor__use_raise_error_in_more_places
2 parents 056ef45 + 5f7922d commit bdcee74

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/ppx_import.ml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -550,17 +550,8 @@ let module_type ~tool_name ~input_name (package_type : Ppxlib.package_type) =
550550
in
551551
Ast_helper.Mty.mk ~attrs:[] (Pmty_signature psig)
552552
| {mtd_type = None; _} ->
553-
let ext =
554-
Ppxlib.Location.error_extensionf ~loc
555-
"Imported module is abstract"
556-
in
557-
Ast_builder.Default.pmty_extension ~loc ext
558-
| _ ->
559-
let ext =
560-
Ppxlib.Location.error_extensionf ~loc
561-
"Imported module is indirectly defined"
562-
in
563-
Ast_builder.Default.pmty_extension ~loc ext )
553+
raise_error ~loc "Imported module is abstract"
554+
| _ -> raise_error ~loc "Imported module is indirectly defined" )
564555
with Error {loc; error} ->
565556
let ext = Ppxlib.Location.error_extensionf ~loc "%s" error in
566557
Ast_builder.Default.pmty_extension ~loc ext

0 commit comments

Comments
 (0)