@@ -294,7 +294,7 @@ var _ catalog.ValidationDescGetter = (*validationDescGetterImpl)(nil)
294294func (vdg * validationDescGetterImpl ) GetDescriptor (id descpb.ID ) (catalog.Descriptor , error ) {
295295 desc , found := vdg .descriptors [id ]
296296 if ! found || desc == nil {
297- return nil , catalog .WrapDescRefErr ( id , catalog . ErrReferencedDescriptorNotFound )
297+ return nil , catalog .NewReferencedDescriptorNotFoundError ( "object" , id )
298298 }
299299 return desc , nil
300300}
@@ -305,7 +305,7 @@ func (vdg *validationDescGetterImpl) GetDatabaseDescriptor(
305305) (catalog.DatabaseDescriptor , error ) {
306306 desc , found := vdg .descriptors [id ]
307307 if ! found || desc == nil {
308- return nil , catalog .WrapDatabaseDescRefErr ( id , catalog . ErrReferencedDescriptorNotFound )
308+ return nil , catalog .NewReferencedDescriptorNotFoundError ( "database" , id )
309309 }
310310 return catalog .AsDatabaseDescriptor (desc )
311311}
@@ -316,7 +316,7 @@ func (vdg *validationDescGetterImpl) GetSchemaDescriptor(
316316) (catalog.SchemaDescriptor , error ) {
317317 desc , found := vdg .descriptors [id ]
318318 if ! found || desc == nil {
319- return nil , catalog .WrapSchemaDescRefErr ( id , catalog . ErrReferencedDescriptorNotFound )
319+ return nil , catalog .NewReferencedDescriptorNotFoundError ( "schema" , id )
320320 }
321321 return catalog .AsSchemaDescriptor (desc )
322322}
@@ -327,7 +327,7 @@ func (vdg *validationDescGetterImpl) GetTableDescriptor(
327327) (catalog.TableDescriptor , error ) {
328328 desc , found := vdg .descriptors [id ]
329329 if ! found || desc == nil {
330- return nil , catalog .WrapTableDescRefErr ( id , catalog . ErrReferencedDescriptorNotFound )
330+ return nil , catalog .NewReferencedDescriptorNotFoundError ( "table" , id )
331331 }
332332 return catalog .AsTableDescriptor (desc )
333333}
@@ -338,7 +338,7 @@ func (vdg *validationDescGetterImpl) GetTypeDescriptor(
338338) (catalog.TypeDescriptor , error ) {
339339 desc , found := vdg .descriptors [id ]
340340 if ! found || desc == nil {
341- return nil , catalog .WrapTypeDescRefErr ( id , catalog . ErrReferencedDescriptorNotFound )
341+ return nil , catalog .NewReferencedDescriptorNotFoundError ( "type" , id )
342342 }
343343 descriptor , err := catalog .AsTypeDescriptor (desc )
344344 if err != nil {
@@ -352,7 +352,7 @@ func (vdg *validationDescGetterImpl) GetFunctionDescriptor(
352352) (catalog.FunctionDescriptor , error ) {
353353 desc , found := vdg .descriptors [id ]
354354 if ! found || desc == nil {
355- return nil , catalog .WrapFunctionDescRefErr ( id , catalog . ErrReferencedDescriptorNotFound )
355+ return nil , catalog .NewReferencedDescriptorNotFoundError ( "function" , id )
356356 }
357357 return catalog .AsFunctionDescriptor (desc )
358358}
0 commit comments