Verified Commit 51e8db48 authored by Camil Staps's avatar Camil Staps 🚀

Fixes #40

parent 70c05db1
...@@ -104,6 +104,7 @@ err c m = { return = c ...@@ -104,6 +104,7 @@ err c m = { return = c
E_NORESULTS :== 127 E_NORESULTS :== 127
E_INVALIDINPUT :== 128 E_INVALIDINPUT :== 128
E_NAMETOOLONG :== 129 E_NAMETOOLONG :== 129
E_INVALIDTYPE :== 130
MAX_RESULTS :== 15 MAX_RESULTS :== 15
...@@ -129,6 +130,8 @@ where ...@@ -129,6 +130,8 @@ where
handle db (Just request=:{unify,name,modules,page}) w handle db (Just request=:{unify,name,modules,page}) w
| isJust name && size (fromJust name) > 40 | isJust name && size (fromJust name) > 40
= (err E_NAMETOOLONG "function name too long", w) = (err E_NAMETOOLONG "function name too long", w)
| isJust unify && isNothing (parseType $ fromString $ fromJust unify)
= (err E_INVALIDTYPE "couldn't parse type", w)
// Results // Results
# drop_n = fromJust (page <|> pure 0) * MAX_RESULTS # drop_n = fromJust (page <|> pure 0) * MAX_RESULTS
# results = drop drop_n $ sort $ search request db # results = drop drop_n $ sort $ search request db
......
...@@ -61,6 +61,7 @@ fields: ...@@ -61,6 +61,7 @@ fields:
* `127`: no results * `127`: no results
* `128`: ununderstandable input (usually shouldn't happen) * `128`: ununderstandable input (usually shouldn't happen)
* `129`: function name too long * `129`: function name too long
* `130`: couldn't parse type
* `150`: the Clean backend could not be reached * `150`: the Clean backend could not be reached
* `151`: invalid request type (should use GET) * `151`: invalid request type (should use GET)
* `152`: no input (GET variable `str` should be set to the search string) * `152`: no input (GET variable `str` should be set to the search string)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment