Details
-
Improvement
-
Resolution: Fixed
-
Major
-
Cheshire-Cat
-
1
Description
Consider this function:
CREATE FUNCTION variadic(...) { CASE WHEN array_length(args) != 1 THEN "wrong args: " || to_string(array_length(args)) WHEN type(args[0]) = "string" THEN args[0] ELSE "wrong type " || type(args[0]) || ": " || to_string(args[0]) END } |
Wouldn't it be nice to be able to return errors on wrong arguments?
Introduce a new predefined function abort(string) which returns nothing and generates an error based on the input string, so that N1QL UDFs (or other statements) can properly generate an error and terminate the request