File tree Expand file tree Collapse file tree
catalogs/iceberg-s3tables-catalog/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use aws_sdk_s3tables::{
44 operation:: {
55 create_namespace:: CreateNamespaceError , create_table:: CreateTableError ,
66 delete_table:: DeleteTableError , get_table:: GetTableError ,
7+ get_table_metadata_location:: GetTableMetadataLocationError ,
78 list_namespaces:: ListNamespacesError , list_tables:: ListTablesError ,
89 update_table_metadata_location:: UpdateTableMetadataLocationError ,
910 } ,
@@ -26,7 +27,11 @@ pub enum Error {
2627 #[ error( transparent) ]
2728 GetTable ( #[ from] SdkError < GetTableError , HttpResponse > ) ,
2829 #[ error( transparent) ]
29- DeletaTable ( #[ from] SdkError < DeleteTableError , HttpResponse > ) ,
30+ DeleteTable ( #[ from] SdkError < DeleteTableError , HttpResponse > ) ,
31+ #[ error( transparent) ]
32+ SdkError ( #[ from] SdkError < GetTableMetadataLocationError , HttpResponse > ) ,
33+ #[ error( transparent) ]
34+ GetTableMetadataLocation ( #[ from] GetTableMetadataLocationError ) ,
3035 #[ error( transparent) ]
3136 CreateTable ( #[ from] SdkError < CreateTableError , HttpResponse > ) ,
3237 #[ error( transparent) ]
Original file line number Diff line number Diff line change @@ -6,7 +6,10 @@ use std::{
66use async_trait:: async_trait;
77use aws_config:: SdkConfig ;
88
9- use aws_sdk_s3tables:: { types:: OpenTableFormat , Client } ;
9+ use aws_sdk_s3tables:: {
10+ error:: SdkError , operation:: get_table_metadata_location:: GetTableMetadataLocationError ,
11+ types:: OpenTableFormat , Client ,
12+ } ;
1013use iceberg_rust:: {
1114 catalog:: {
1215 commit:: {
@@ -236,7 +239,15 @@ impl Catalog for S3TablesCatalog {
236239 . name ( identifier. name ( ) )
237240 . send ( )
238241 . await
239- . map_err ( |_| IcebergError :: CatalogNotFound ) ?;
242+ . map_err ( |err| match err {
243+ SdkError :: ServiceError ( err) => match err. into_err ( ) {
244+ GetTableMetadataLocationError :: NotFoundException ( _) => {
245+ IcebergError :: CatalogNotFound
246+ }
247+ x => Error :: from ( x) . into ( ) ,
248+ } ,
249+ x => Error :: from ( x) . into ( ) ,
250+ } ) ?;
240251
241252 let metadata_location = table. metadata_location . ok_or ( Error :: Text ( format ! (
242253 "Table {} not found." ,
You can’t perform that action at this time.
0 commit comments