File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
packages/cubejs-query-orchestrator/test/unit Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -32,11 +32,21 @@ class MockDriver {
3232 return this . getSchemas ( ) ;
3333 } else if ( operation === 'METADATA:GET_TABLES_FOR_SCHEMAS' ) {
3434 // Parse parameters from the query array
35- const params = query [ 1 ] && query [ 1 ] . length > 0 ? JSON . parse ( query [ 1 ] [ 0 ] ) : { } ;
35+ let params = { } ;
36+ try {
37+ params = query [ 1 ] && query [ 1 ] . length > 0 ? JSON . parse ( query [ 1 ] [ 0 ] ) : { } ;
38+ } catch ( error ) {
39+ console . warn ( 'Failed to parse JSON parameters for METADATA:GET_TABLES_FOR_SCHEMAS:' , error ) ;
40+ }
3641 return this . getTablesForSpecificSchemas ( params . schemas || [ ] ) ;
3742 } else if ( operation === 'METADATA:GET_COLUMNS_FOR_TABLES' ) {
3843 // Parse parameters from the query array
39- const params = query [ 1 ] && query [ 1 ] . length > 0 ? JSON . parse ( query [ 1 ] [ 0 ] ) : { } ;
44+ let params = { } ;
45+ try {
46+ params = query [ 1 ] && query [ 1 ] . length > 0 ? JSON . parse ( query [ 1 ] [ 0 ] ) : { } ;
47+ } catch ( error ) {
48+ console . warn ( 'Failed to parse JSON parameters for METADATA:GET_COLUMNS_FOR_TABLES:' , error ) ;
49+ }
4050 return this . getColumnsForSpecificTables ( params . tables || [ ] ) ;
4151 }
4252 }
You can’t perform that action at this time.
0 commit comments