File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,13 @@ let registered s =
64
64
try ignore(find s); true
65
65
with Not_found -> false
66
66
67
- let enabled s = (find s).fd_enabled
67
+ let enabled s = try (find s).fd_enabled with Not_found -> false
68
68
69
- let enable s = let f = find s in f.fd_enabled < - true
69
+ let enable s =
70
+ try
71
+ let f = find s in f.fd_enabled < - true
72
+ with Not_found ->
73
+ E. s (E. error " cannot enable feature %s: not found" s)
70
74
71
75
(* * Dynamic linking *)
72
76
Original file line number Diff line number Diff line change @@ -72,11 +72,11 @@ val registered : string -> bool
72
72
(* * Find a feature by name. Raise Not_found if the feature is not registered. *)
73
73
val find : string -> t
74
74
75
- (* * Enable a given feature, by name. Raise Not_found if the feature is not
75
+ (* * Enable a given feature, by name. Raise {!Errormsg.Error} if the feature is not
76
76
* registered. *)
77
77
val enable : string -> unit
78
78
79
- (* * Check if a given feature is enabled. Raise Not_found if the feature is not
79
+ (* * Check if a given feature is enabled. Return false if the feature is not
80
80
* registered. *)
81
81
val enabled : string -> bool
82
82
You can’t perform that action at this time.
0 commit comments