Skip to content

Commit 2c64dbd

Browse files
author
Jérôme Arzel
committed
Adding Missing_section exception
1 parent 565498c commit 2c64dbd

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

lib/mustache.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ module Lookup = struct
160160
| (`A _ | `O _) as js -> js
161161
| _ -> js
162162
with Not_found ->
163-
if strict then raise Not_found else `Bool false
163+
if strict then raise (Missing_section key) else `Bool false
164164

165165
let inverted (js : Json.value) ~key =
166166
match js with

lib/mustache.mli

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ exception Invalid_template of string
44

55
(** Raised when a missing variable in a template is not substituted *)
66
exception Missing_variable of string
7+
exception Missing_section of string
78

89
module Json : sig (** Compatible with Ezjsonm *)
910
type value =

lib/mustache_types.ml

+1
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ and section = {
3636
exception Invalid_param of string
3737
exception Invalid_template of string
3838
exception Missing_variable of string
39+
exception Missing_section of string

0 commit comments

Comments
 (0)