Skip to content
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

replace type assertion with errors.As for unauthorizedError handling #20938

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Firstnsnd
Copy link

Thank you for contributing to Harbor!

Description

This PR refactors the error handling logic to replace the type assertion err.(*unauthorizedError) with errors.As. This change improves the handling of errors that may be wrapped, making the code more robust and easier to maintain.

change

  • Replaced err.(*unauthorizedError) with errors.As to check for the unauthorized error type.

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.

4 participants