diff --git a/CloogleServer.icl b/CloogleServer.icl index cf16a0cd9360b93538d08a311aa205585e73868d..cd4311567251e3854f42e96591a7e9997fe20300 100644 --- a/CloogleServer.icl +++ b/CloogleServer.icl @@ -104,6 +104,7 @@ err c m = { return = c E_NORESULTS :== 127 E_INVALIDINPUT :== 128 E_NAMETOOLONG :== 129 +E_INVALIDTYPE :== 130 MAX_RESULTS :== 15 @@ -129,6 +130,8 @@ where handle db (Just request=:{unify,name,modules,page}) w | isJust name && size (fromJust name) > 40 = (err E_NAMETOOLONG "function name too long", w) + | isJust unify && isNothing (parseType $ fromString $ fromJust unify) + = (err E_INVALIDTYPE "couldn't parse type", w) // Results # drop_n = fromJust (page <|> pure 0) * MAX_RESULTS # results = drop drop_n $ sort $ search request db diff --git a/README.md b/README.md index 4763d08b45c335a2749d51add41e9414b45e0c30..d57508482c1134d12bf662eba1f7ce3de2461c61 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ fields: * `127`: no results * `128`: ununderstandable input (usually shouldn't happen) * `129`: function name too long + * `130`: couldn't parse type * `150`: the Clean backend could not be reached * `151`: invalid request type (should use GET) * `152`: no input (GET variable `str` should be set to the search string)