CartoDB / camshaft

Analysis library to create data views from queries
BSD 3-Clause "New" or "Revised" License
17 stars 7 forks source link

Catch error when filters are not valid #384

Closed dgaubert closed 5 years ago

dgaubert commented 5 years ago

Fixes https://github.com/CartoDB/camshaft/issues/383

And avoids the following uncaught exception:

[2019-03-26 14:59:22.758] [ERROR] [default] - Uncaught exception: Error: Range filter expect to have at least one value in greater_than, greater_than_or_equal, less_than, less_than_or_equal, min, or max numeric params
    at new Range (/node_modules/camshaft/lib/filter/range.js:25:15)
    at createFilter (/node_modules/camshaft/lib/filter/query-builder.js:40:12)
    at /node_modules/camshaft/lib/filter/query-builder.js:14:20
    at Array.map (<anonymous>)
    at Object.QueryBuilder$getSql [as getSql] (/node_modules/camshaft/lib/filter/query-builder.js:12:10)
    at BaseNode.Node.getQuery (/node_modules/camshaft/lib/node/node.js:144:25)
    at BaseNode.FilterCategory.sql (/node_modules/camshaft/lib/node/nodes/filter-category.js:26:42)
    at BaseNode.Node.getQuery (/node_modules/camshaft/lib/node/node.js:134:22)
    at DatabaseService.getColumns (/node_modules/camshaft/lib/service/database.js:129:38)
    at /node_modules/camshaft/lib/workflow/factory.js:109:42