fixed the error translation from the statusCodeError type into a corresponding graph api Error representation
This commit is contained in:
@@ -207,7 +207,7 @@ func (s DriveItemPermissionsService) SpaceRootInvite(ctx context.Context, driveI
|
||||
|
||||
space, err := utils.GetSpace(ctx, storagespace.FormatResourceID(driveID), gatewayClient)
|
||||
if err != nil {
|
||||
return libregraph.Permission{}, err
|
||||
return libregraph.Permission{}, errorcode.FromUtilsStatusCodeError(err)
|
||||
}
|
||||
|
||||
if space.SpaceType != _spaceTypeProject {
|
||||
@@ -298,7 +298,7 @@ func (s DriveItemPermissionsService) ListSpaceRootPermissions(ctx context.Contex
|
||||
|
||||
space, err := utils.GetSpace(ctx, storagespace.FormatResourceID(driveID), gatewayClient)
|
||||
if err != nil {
|
||||
return collectionOfPermissions, err
|
||||
return collectionOfPermissions, errorcode.FromUtilsStatusCodeError(err)
|
||||
}
|
||||
|
||||
if space.SpaceType != _spaceTypeProject {
|
||||
@@ -371,7 +371,7 @@ func (s DriveItemPermissionsService) DeleteSpaceRootPermission(ctx context.Conte
|
||||
|
||||
space, err := utils.GetSpace(ctx, storagespace.FormatResourceID(driveID), gatewayClient)
|
||||
if err != nil {
|
||||
return err
|
||||
return errorcode.FromUtilsStatusCodeError(err)
|
||||
}
|
||||
|
||||
if space.SpaceType != _spaceTypeProject {
|
||||
@@ -422,7 +422,7 @@ func (s DriveItemPermissionsService) UpdateSpaceRootPermission(ctx context.Conte
|
||||
|
||||
space, err := utils.GetSpace(ctx, storagespace.FormatResourceID(driveID), gatewayClient)
|
||||
if err != nil {
|
||||
return libregraph.Permission{}, err
|
||||
return libregraph.Permission{}, errorcode.FromUtilsStatusCodeError(err)
|
||||
}
|
||||
|
||||
if space.SpaceType != _spaceTypeProject {
|
||||
|
||||
@@ -102,7 +102,7 @@ func (s DriveItemPermissionsService) CreateSpaceRootLink(ctx context.Context, dr
|
||||
}
|
||||
space, err := utils.GetSpace(ctx, storagespace.FormatResourceID(driveID), gatewayClient)
|
||||
if err != nil {
|
||||
return libregraph.Permission{}, err
|
||||
return libregraph.Permission{}, errorcode.FromUtilsStatusCodeError(err)
|
||||
}
|
||||
|
||||
if space.SpaceType != _spaceTypeProject {
|
||||
@@ -140,7 +140,7 @@ func (s DriveItemPermissionsService) SetPublicLinkPasswordOnSpaceRoot(ctx contex
|
||||
}
|
||||
space, err := utils.GetSpace(ctx, storagespace.FormatResourceID(driveID), gatewayClient)
|
||||
if err != nil {
|
||||
return libregraph.Permission{}, err
|
||||
return libregraph.Permission{}, errorcode.FromUtilsStatusCodeError(err)
|
||||
}
|
||||
|
||||
if space.SpaceType != _spaceTypeProject {
|
||||
|
||||
@@ -55,7 +55,7 @@ func (g BaseGraphService) getSpaceRootPermissions(ctx context.Context, spaceID *
|
||||
}
|
||||
space, err := utils.GetSpace(ctx, spaceID.GetOpaqueId(), gatewayClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errorcode.FromUtilsStatusCodeError(err)
|
||||
}
|
||||
|
||||
return g.cs3SpacePermissionsToLibreGraph(ctx, space, APIVersion_1_Beta_1), nil
|
||||
|
||||
Reference in New Issue
Block a user