Skip to content

Conversation

alan-agius4
Copy link
Collaborator

Early exits and reduce optional chaining.

@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release labels Apr 16, 2025
@alan-agius4 alan-agius4 requested a review from jkrems April 16, 2025 09:39
Copy link
Contributor

@jkrems jkrems left a comment

Choose a reason for hiding this comment

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

This does now have the potential to call next multiple times in case of errors. But that might be okay..?

(The code invoked by next() may throw which then could get caught by this function and trigger a 2nd call to next().)

@alan-agius4
Copy link
Collaborator Author

This does now have the potential to call next multiple times in case of errors. But that might be okay..?

(The code invoked by next() may throw which then could get caught by this function and trigger a 2nd call to next().)

Yes, that should be fine though, what was the intent of the try/catch was it to catch error from this.serveFile or handle invalid new URL?

@jkrems
Copy link
Contributor

jkrems commented Apr 17, 2025

Yes, that should be fine though, what was the intent of the try/catch was it to catch error from this.serveFile or handle invalid new URL?

That's a good point! Since this entirely synchronous, we could likely depend on the framework to catch errors and remove the try/catch.

@1979Allen

This comment was marked as spam.

Early exits and reduce optional chaining.
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 22, 2025
@alan-agius4 alan-agius4 merged commit 0459d80 into angular:main Apr 22, 2025
31 checks passed
@alan-agius4 alan-agius4 deleted the handle-cleanup branch April 22, 2025 11:20
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants