Skip to content

Commit

Permalink
Misleading error "Cannot delete an already deleted object" (#83410)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobsaila committed Mar 15, 2023
1 parent 2efdd7e commit 0028758
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
<data name="PrincipalCantDeleteUnpersisted" xml:space="preserve">
<value>Unpersisted Principal objects can not be deleted.</value>
</data>
<data name="PrincipalDeleted" xml:space="preserve">
<value>Cannot delete an already deleted object</value>
<data name="PrincipalAccessedAfterBeingDeleted" xml:space="preserve">
<value>Cannot access an already deleted object</value>
</data>
<data name="PrincipalNotSupportedOnFakePrincipal" xml:space="preserve">
<value>This Principal object represents a well-known SID and does not correspond to an actual store object. This operation is not supported on it.</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ protected void CheckDisposedOrDeleted()
if (_isDeleted)
{
GlobalDebug.WriteLineIf(GlobalDebug.Warn, "Principal", "CheckDisposedOrDeleted: accessing deleted object");
throw new InvalidOperationException(SR.PrincipalDeleted);
throw new InvalidOperationException(SR.PrincipalAccessedAfterBeingDeleted);
}
}

Expand Down

0 comments on commit 0028758

Please sign in to comment.