Skip to content

Commit 5f7922d

Browse files
committed
refactor: use raise_error in more places
<!-- ps-id: c95afbfc-ac60-4ebf-9028-bdc9a4dab7a9 -->
1 parent 54e5278 commit 5f7922d

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)