Skip to content

Code Quality: Use newer syntaxes for ArgumentException handling #17258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 10, 2025

Conversation

corvinsz
Copy link
Contributor

@corvinsz corvinsz commented Jul 8, 2025

Updated code to use newer syntaxes and APIs.
There is no issue related to this PR.

Some of the exceptions I purposely didn't change to preserve the custom message, e.g.:

if (string.IsNullOrEmpty(backingFile.Path))
{
    throw new ArgumentException("Backing file Path cannot be null");
}

@yaira2
Copy link
Member

yaira2 commented Jul 8, 2025

Thank you for your interest in Files. Please link to an approved issue as per the contributing guidelines.

Copy link
Member

@0x5bfa 0x5bfa left a comment

Choose a reason for hiding this comment

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

LGTM.

Some of the exceptions I purposely didn't change to preserve the custom message, e.g.:

Where is this? I think it's good to change them as well.

@corvinsz
Copy link
Contributor Author

corvinsz commented Jul 9, 2025

Where is this? I think it's good to change them as well.

https://github.com/corvinsz/Files/blob/fe5215713dba4302a5a263a5309025bed79a707c/src/Files.App/Utils/Storage/StorageItems/ZipStorageFolder.cs?plain=1#L50-L53

I can fix it this evening, if you are not faster than me 😄

@0x5bfa
Copy link
Member

0x5bfa commented Jul 9, 2025

I'm tied up with something else, so feel free 🙂

Copy link
Member

@0x5bfa 0x5bfa left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for your contribution, however, please first take a look at our contribution guides before working on a task. Thanks for understanding too.

@yaira2 yaira2 added the ready to merge Pull requests that are approved and ready to merge label Jul 10, 2025
@yaira2 yaira2 changed the title Code Quality: use newer syntaxes/APIs Code Quality: Use newer syntaxes for ArgumentException handling Jul 10, 2025
@yaira2 yaira2 merged commit 6b8a578 into files-community:main Jul 10, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants