Skip to content

Commit

Permalink
Merge pull request #20 from jerome-arzel/master
Browse files Browse the repository at this point in the history
Adding Missing_section exception
  • Loading branch information
rgrinberg authored Aug 4, 2016
2 parents 565498c + 2c64dbd commit a641057
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mustache.ml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ module Lookup = struct
| (`A _ | `O _) as js -> js
| _ -> js
with Not_found ->
if strict then raise Not_found else `Bool false
if strict then raise (Missing_section key) else `Bool false

let inverted (js : Json.value) ~key =
match js with
Expand Down
1 change: 1 addition & 0 deletions lib/mustache.mli
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exception Invalid_template of string

(** Raised when a missing variable in a template is not substituted *)
exception Missing_variable of string
exception Missing_section of string

module Json : sig (** Compatible with Ezjsonm *)
type value =
Expand Down
1 change: 1 addition & 0 deletions lib/mustache_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ and section = {
exception Invalid_param of string
exception Invalid_template of string
exception Missing_variable of string
exception Missing_section of string

0 comments on commit a641057

Please sign in to comment.