Skip to content

Commit

Permalink
add error reporting for 'LoadMDSetting.MissingRequiredKey(...)'
Browse files Browse the repository at this point in the history
  • Loading branch information
gfngfn committed Oct 16, 2018
1 parent 4619400 commit 1c5da6a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/frontend/loadMDSetting.mli
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@

type file_path = string

exception MultipleDesignation of file_path * string
exception InvalidYOJSON of file_path * string
exception MissingRequiredKey of file_path * string
exception InvalidValueForKey of file_path * string

val main : string -> DecodeMD.command_record * string list
6 changes: 6 additions & 0 deletions src/frontend/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,12 @@ let error_log_environment suspended =
NormalLine("at " ^ (Range.to_string rng) ^ ":");
]

| LoadMDSetting.MissingRequiredKey(srcpath, key) ->
report_error System [
NormalLine("in " ^ srcpath ^ ":");
NormalLine("missing required key '" ^ key ^ "'.");
]

| Typechecker.UndefinedVariable(rng, mdlnmlst, varnm, candidates) ->
let s = String.concat "." (List.append mdlnmlst [varnm]) in
report_error Typechecker [
Expand Down

0 comments on commit 1c5da6a

Please sign in to comment.