@@ -21,6 +21,45 @@ const globalCallbacks = globalCallbacksList
2121globalCallbacks . onSocketOpen = ( ) => logger . info ( "connected." ) ;
2222globalCallbacks . onSocketClose = ( ) => logger . info ( "connection closed." ) ;
2323
24+ describe . only ( "error handling" , ( ) => {
25+ let bdInstance : BoilingData = new BoilingData ( { username, password, globalCallbacks, logLevel, region : "eu-west-1" } ) ;
26+
27+ beforeAll ( async ( ) => {
28+ bdInstance = new BoilingData ( { username, password, globalCallbacks, logLevel } ) ;
29+ await bdInstance . connect ( ) ;
30+ logger . info ( "connected." ) ;
31+ } ) ;
32+
33+ afterAll ( async ( ) => {
34+ await bdInstance . close ( ) ;
35+ logger . info ( "connection closed." ) ;
36+ } ) ;
37+
38+ it ( "missing catalog" , async ( ) => {
39+ const sql = "SELECT * FROM taxi_locations_limited;" ;
40+ try {
41+ const rows = await bdInstance . execQueryPromise ( { sql } ) ;
42+ console . log ( { rows } ) ;
43+ } catch ( err ) {
44+ // console.error(err);
45+ // console.log(err.logMessage);
46+ expect ( err . logMessage ) . toContain ( "Catalog Error: Table with name taxi_locations_limited does not exist" ) ;
47+ }
48+ } ) ;
49+
50+ it ( "random test queries" , async ( ) => {
51+ try {
52+ const sql = "DESCRIBE taxi_locations; -- Database: boiling.sharedtome" ;
53+ const rows = await bdInstance . execQueryPromise ( { sql } ) ;
54+ console . log ( { rows } ) ;
55+ } catch ( err ) {
56+ //console.error(err);
57+ //console.log(err.logMessage);
58+ expect ( err . logMessage ) . toContain ( 'Error: syntax error at or near "taxi_locations"' ) ;
59+ }
60+ } ) ;
61+ } ) ;
62+
2463describe ( "boilingdata with DuckDB" , ( ) => {
2564 let bdInstance : BoilingData = new BoilingData ( { username, password, globalCallbacks, logLevel, region : "eu-west-1" } ) ;
2665
0 commit comments