Skip to content

Get/Add-Content throws improved error when targeting a container - #7823

Merged
Ilya (iSazonov) merged 4 commits into
PowerShell:masterfrom
kvprasoon:master
Sep 28, 2018
Merged

Ilya (iSazonov) merged 4 commits into
PowerShell:masterfrom
kvprasoon:master

Conversation

@kvprasoon

Copy link
Copy Markdown
Contributor

PR Summary

Fix #7770
Fix #2686

Enhancing the error message as per #7770 and #2686

PR Checklist

@kvprasoon

PRASOON KARUNAN V (kvprasoon) commented Sep 20, 2018 •

Copy link
Copy Markdown
Contributor Author

Ilya (@iSazonov) I think more rules are added to CodeFactor, issues are in untouched lines.
Even CI failure is something different.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We need another message for "write" cmdlets.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added different error message for Write to container exception.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please fix the line.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please remove obvious comment.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please remove obvious comment.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd prefer {0} on end of the string because we support long paths.

Unable to write content because it is a directory: {0}

For GetContainerContentException too.
/cc Steve Lee (@SteveL-MSFT)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, that makes sense.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the updated error messages are fine, even for GetContainerContentException.

@SteveL-MSFT

Copy link
Copy Markdown
Member

The package validation on NJsonSchema is a known issue not related to this PR

@SteveL-MSFT Steve Lee (SteveL-MSFT) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@iSazonov

Copy link
Copy Markdown
Collaborator

Reopen the PR to restart all CIs.

@SteveL-MSFT

Copy link
Copy Markdown
Member

PRASOON KARUNAN V (@kvprasoon) can you rebase off master to pick up test fixes?

@iSazonov Ilya (iSazonov) self-assigned this Sep 25, 2018
Get/Add-Content throws improved error when targeting a container
CodeFactor Fix
Review comments changes
Error message changes as per review comments,
@iSazonov

Copy link
Copy Markdown
Collaborator

PRASOON KARUNAN V (@kvprasoon) I rebased for you.

Further please create new branch in your fork for every new change (don't put commits in forked master).

@kvprasoon

PRASOON KARUNAN V (kvprasoon) commented Sep 28, 2018 •

Copy link
Copy Markdown
Contributor Author

Ilya (@iSazonov) Sure, will do it, learning OSS collaboration from each PR... thanks

@iSazonov
Ilya (iSazonov) merged commit e6702fe into PowerShell:master Sep 28, 2018
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
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.

Get-Content throws confusing error when targeting a container Bad error message when using Get-Content with a Directory

3 participants