You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the process of working on #564, I found some error messages that are not caused by malli. These are issues we are failing to catch in validation in the first place in v3, but we used to catch in v2.
Extra nesting in where clause:
'{:select {?s [*]}
:where [[[?s ?p ?o]]]}
;;=>
#error
{:cause"class clojure.lang.PersistentVector cannot be cast to class java.lang.CharSequence (clojure.lang.PersistentVector is in unnamed module of loader 'app'; java.lang.CharSequence is in module java.base of loader 'bootstrap')":via
[{:type clojure.lang.ExceptionInfo
:message"Error attempting to parse iri: [?s ?p ?o]":data {:status400, :error:json-ld/invalid-iri}
:at [fluree.json_ld.impl.iri$parse_prefix invokeStatic "iri.cljc"44]}
{:type java.lang.ClassCastException
:message"class clojure.lang.PersistentVector cannot be cast to class java.lang.CharSequence (clojure.lang.PersistentVector is in unnamed module of loader 'app'; java.lang.CharSequence is in module java.base of loader 'bootstrap')":at [clojure.core$re_matcher invokeStatic "core.clj"4874]}]}
Insufficient entries in where clause:
'{:select {?s [*]}
:where [[?s]]}
;;=>
#error
{:cause"Cannot invoke \"java.lang.CharSequence.length()\" because \"this.text\" is null"
:via
[{:type clojure.lang.ExceptionInfo
:message"Error attempting to parse iri: ":data {:status400, :error:json-ld/invalid-iri}
:at [fluree.json_ld.impl.iri$parse_prefix invokeStatic "iri.cljc"44]}
{:type java.lang.NullPointerException
:message"Cannot invoke \"java.lang.CharSequence.length()\" because \"this.text\" is null":at [java.util.regex.Matcher getTextLength "Matcher.java"1769]}]}
In v2 we caught these early and gave good hints about what might be wrong:
(if (sequential? (first clause))
(throw (ex-info (str"Invalid where clause, it appears you have an extra nested vector here: " clause)
{:status400:error:db/invalid-query}))
(throw (ex-info (str"Invalid where clause, it should have 2+ tuples but instead found: " clause)
{:status400:error:db/invalid-query})) )
The text was updated successfully, but these errors were encountered:
In the process of working on #564, I found some error messages that are not caused by malli. These are issues we are failing to catch in validation in the first place in v3, but we used to catch in v2.
In v2 we caught these early and gave good hints about what might be wrong:
(from https://github.com/fluree/db/blob/maintenance/v2/src/fluree/db/query/analytical.cljc#L873)
The text was updated successfully, but these errors were encountered: