Skip to content

Commit

Permalink
refactor: use raise_error in more places
Browse files Browse the repository at this point in the history
<!-- ps-id: c95afbfc-ac60-4ebf-9028-bdc9a4dab7a9 -->
  • Loading branch information
tatchi committed Feb 8, 2023
1 parent 54e5278 commit 5f7922d
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/ppx_import.ml
Original file line number Diff line number Diff line change
Expand Up @@ -550,17 +550,8 @@ let module_type ~tool_name ~input_name (package_type : Ppxlib.package_type) =
in
Ast_helper.Mty.mk ~attrs:[] (Pmty_signature psig)
| {mtd_type = None; _} ->
let ext =
Ppxlib.Location.error_extensionf ~loc
"Imported module is abstract"
in
Ast_builder.Default.pmty_extension ~loc ext
| _ ->
let ext =
Ppxlib.Location.error_extensionf ~loc
"Imported module is indirectly defined"
in
Ast_builder.Default.pmty_extension ~loc ext )
raise_error ~loc "Imported module is abstract"
| _ -> raise_error ~loc "Imported module is indirectly defined" )
with Error {loc; error} ->
let ext = Ppxlib.Location.error_extensionf ~loc "%s" error in
Ast_builder.Default.pmty_extension ~loc ext
Expand Down

0 comments on commit 5f7922d

Please sign in to comment.