@@ -43,14 +43,16 @@ export enum ErrorCode {
4343 NotSupported = 'NotSupported' ,
4444 IcebergError = 'IcebergError' ,
4545 IcebergMaximumResourceLimit = 'IcebergMaximumResourceLimit' ,
46+ IcebergResourceNotEmpty = 'IcebergResourceNotEmpty' ,
4647 NoSuchCatalog = 'NoSuchCatalog' ,
4748
4849 S3VectorConflictException = 'ConflictException' ,
4950 S3VectorNotFoundException = 'NotFoundException' ,
5051 S3VectorBucketNotEmpty = 'VectorBucketNotEmpty' ,
5152 S3VectorMaxBucketsExceeded = 'S3VectorMaxBucketsExceeded' ,
5253 S3VectorMaxIndexesExceeded = 'S3VectorMaxIndexesExceeded' ,
53- S3VectorNoAvailableShard = 'S3VectorNoAvailableShard' ,
54+ NoAvailableShard = 'NoAvailableShard' ,
55+ ShardNotFound = 'ShardNotFound' ,
5456}
5557
5658export const ERRORS = {
@@ -69,6 +71,13 @@ export const ERRORS = {
6971 message : `The maximum number of this resource ${ limit } is reached` ,
7072 originalError : e ,
7173 } ) ,
74+ IcebergResourceNotEmpty : ( resource : string , name : string , e ?: Error ) =>
75+ new StorageBackendError ( {
76+ code : ErrorCode . IcebergResourceNotEmpty ,
77+ httpStatusCode : 400 ,
78+ message : `The resource ${ resource } : ${ name } is not empty` ,
79+ originalError : e ,
80+ } ) ,
7281 FeatureNotEnabled : ( resource : string , feature : string , e ?: Error ) =>
7382 new StorageBackendError ( {
7483 code : ErrorCode . InvalidRequest ,
@@ -472,11 +481,18 @@ export const ERRORS = {
472481 message : `Maximum number of indexes exceeded. Max allowed is ${ maxIndexes } . Contact support to increase your limit.` ,
473482 } )
474483 } ,
475- S3VectorNoAvailableShard ( ) {
484+ NoAvailableShard ( ) {
476485 return new StorageBackendError ( {
477- code : ErrorCode . S3VectorNoAvailableShard ,
486+ code : ErrorCode . NoAvailableShard ,
478487 httpStatusCode : 500 ,
479- message : `No available shards are available to host the vector index. Please try again later.` ,
488+ message : `No available shards are available to host the resource. Please try again later.` ,
489+ } )
490+ } ,
491+ ShardNotFound ( shardId : string ) {
492+ return new StorageBackendError ( {
493+ code : ErrorCode . ShardNotFound ,
494+ httpStatusCode : 404 ,
495+ message : `Shard not found: ${ shardId } ` ,
480496 } )
481497 } ,
482498}
0 commit comments