Skip to content
Browse files

[enhance] compiler, database: Enhance error message

  • Loading branch information...
1 parent 2a857dd commit 49f22b34ffe046e4cdc7ffa36d2d10e2a21ec85b @BourgerieQuentin BourgerieQuentin committed Mar 29, 2012
Showing with 7 additions and 4 deletions.
  1. +2 −3 libqmlcompil/dbGen/schemaGraphLib.ml
  2. +5 −1 libqmlcompil/dbGen/schema_private.ml
View
5 libqmlcompil/dbGen/schemaGraphLib.ml
@@ -1,5 +1,5 @@
(*
- Copyright © 2011 MLstate
+ Copyright © 2011, 2012 MLstate
This file is part of OPA.
@@ -172,8 +172,7 @@ let rec find_field_edge t node field =
let multi_key t n =
match List.map E.label (SchemaGraph0.succ_e t n) with
| [{C.label = C.Multi_edge k}] -> k
- (* TODO: adapt to sets with multiple keys *)
- | _ -> assert false
+ | _ -> raise Not_found
(** @return the key type of a Mult node *)
let type_of_key t n = match multi_key t n with
View
6 libqmlcompil/dbGen/schema_private.ml
@@ -1015,7 +1015,11 @@ let rec convert_dbpath ~context t gamma node kind path0 path =
let ty =
match SchemaGraphLib.type_of_node node with
| Q.TypeName ([setparam; _], name) when Q.TypeIdent.to_string name = "dbset" -> setparam
- | _ -> SchemaGraphLib.type_of_key t node
+ | _ ->
+ try
+ SchemaGraphLib.type_of_key t node
+ with Not_found ->
+ cerror "According the path definition, query is invalid"
in
coerce_query_element ~context gamma ty (query, options)
in

0 comments on commit 49f22b3

Please sign in to comment.
Something went wrong with that request. Please try again.