@@ -37,7 +37,7 @@ struct CatalogTests {
3737 func setCurrentCatalog( ) async throws {
3838 let spark = try await SparkSession . builder. getOrCreate ( )
3939 try await spark. catalog. setCurrentCatalog ( " spark_catalog " )
40- try await #require( throws: Error . self ) {
40+ try await #require( throws: SparkConnectError . CatalogNotFound ) {
4141 try await spark. catalog. setCurrentCatalog ( " not_exist_catalog " )
4242 }
4343 await spark. stop ( )
@@ -63,7 +63,7 @@ struct CatalogTests {
6363 func setCurrentDatabase( ) async throws {
6464 let spark = try await SparkSession . builder. getOrCreate ( )
6565 try await spark. catalog. setCurrentDatabase ( " default " )
66- try await #require( throws: Error . self ) {
66+ try await #require( throws: SparkConnectError . SchemaNotFound ) {
6767 try await spark. catalog. setCurrentDatabase ( " not_exist_database " )
6868 }
6969 await spark. stop ( )
@@ -91,7 +91,7 @@ struct CatalogTests {
9191 #expect( db. catalog == " spark_catalog " )
9292 #expect( db. description == " default database " )
9393 #expect( db. locationUri. hasSuffix ( " spark-warehouse " ) )
94- try await #require( throws: Error . self ) {
94+ try await #require( throws: SparkConnectError . SchemaNotFound ) {
9595 try await spark. catalog. getDatabase ( " not_exist_database " )
9696 }
9797 await spark. stop ( )
@@ -313,7 +313,7 @@ struct CatalogTests {
313313 try await spark. catalog. cacheTable ( tableName, StorageLevel . MEMORY_ONLY)
314314 } )
315315
316- try await #require( throws: Error . self ) {
316+ try await #require( throws: SparkConnectError . TableOrViewNotFound ) {
317317 try await spark. catalog. cacheTable ( " not_exist_table " )
318318 }
319319 await spark. stop ( )
@@ -330,7 +330,7 @@ struct CatalogTests {
330330 #expect( try await spark. catalog. isCached ( tableName) )
331331 } )
332332
333- try await #require( throws: Error . self ) {
333+ try await #require( throws: SparkConnectError . TableOrViewNotFound ) {
334334 try await spark. catalog. isCached ( " not_exist_table " )
335335 }
336336 await spark. stop ( )
@@ -351,7 +351,7 @@ struct CatalogTests {
351351 #expect( try await spark. catalog. isCached ( tableName) )
352352 } )
353353
354- try await #require( throws: Error . self ) {
354+ try await #require( throws: SparkConnectError . TableOrViewNotFound ) {
355355 try await spark. catalog. refreshTable ( " not_exist_table " )
356356 }
357357 await spark. stop ( )
@@ -386,7 +386,7 @@ struct CatalogTests {
386386 #expect( try await spark. catalog. isCached ( tableName) == false )
387387 } )
388388
389- try await #require( throws: Error . self ) {
389+ try await #require( throws: SparkConnectError . TableOrViewNotFound ) {
390390 try await spark. catalog. uncacheTable ( " not_exist_table " )
391391 }
392392 await spark. stop ( )
0 commit comments