Skip to content

Conversation

@iSazonov
Copy link
Collaborator

@iSazonov iSazonov commented Nov 7, 2017

Fix #5353

@iSazonov iSazonov force-pushed the fix-error-in-unblock-file branch from c6a244a to 668028b Compare November 7, 2017 08:19
@iSazonov iSazonov requested a review from SteveL-MSFT November 7, 2017 09:00
Copy link
Contributor

@lzybkr lzybkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see there are existing tests for "file does not exist" and they still pass, so this change looks good.

WriteError(new ErrorRecord(accessException, "RemoveItemUnauthorizedAccessError", ErrorCategory.PermissionDenied, path));
// NativeErrorCode=2 - File not found.
// If the block stream not found the 'path' was not blocked and we successfully return.
if (accessException.NativeErrorCode != 2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpsnover suggests adding a verbose message here if the block stream is not found

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I tried to avoid adding a resource string

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to add a resource string saying:

File '{0}' did not contain a 'Zone.Identifier' file stream and was already not blocked.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a resouce string with {0} at last position - we should take into account long paths.

WriteError(new ErrorRecord(accessException, "RemoveItemUnauthorizedAccessError", ErrorCategory.PermissionDenied, path));
// NativeErrorCode=2 - File not found.
// If the block stream not found the 'path' was not blocked and we successfully return.
if (accessException.NativeErrorCode != 2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to add a resource string saying:

File '{0}' did not contain a 'Zone.Identifier' file stream and was already not blocked.

<value>'{0}' is not supported in this system.</value>
</data>
<data name="NoZoneIdentifierFileStream" xml:space="preserve">
<value>"No 'Zone.Identifier' file stream. The file was already not blocked: {0}"</value>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be present tense e.g. "The file is already not blocked: ..."? Maybe ask one of your documentation folks about the wording for this error message? Sorry but error messages in PowerShell really need help and I'd rather we not contribute to the problem with poor error messages. Do you have a "doc/grammar" person to review error messages?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file is already unblocked:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rkeithhill unfortunately at this time, our previous doc person left Msft. Doc changes aren't breaking, so we can continue to improve them. I agree reading it again that it should probably be present tense: The file is already not blocked.

@markekraus perhaps I'm a bit pedantic on this one, but unblocked implies the file was once blocked which may not have been the case here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SteveL-MSFT You're right, and what Keith wrote is more accurate. but already not blocked sounds odd.. maybe The file is not blocked?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markekraus agree, that sounds better: The file is not blocked.

Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iSazonov can you make the requested string change?

@iSazonov
Copy link
Collaborator Author

iSazonov commented Nov 10, 2017

Yes, I agree.
Is it good (first part too):
"No 'Zone.Identifier' file stream. The file is not blocked: {0}"

@SteveL-MSFT
Copy link
Member

@iSazonov thinking about it, I think it may be better to exclude that implementation detail as it may confuse some users. I think just:

The file is not blocked: {0}

Is good.

@iSazonov
Copy link
Collaborator Author

Done.

@iSazonov iSazonov merged commit 5fd1b47 into PowerShell:master Nov 10, 2017
@iSazonov iSazonov deleted the fix-error-in-unblock-file branch November 10, 2017 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants