Skip to content

refactor: minor code changes in karma AngularAssetsMiddleware #30115

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alan-agius4
Copy link
Collaborator

Early exits and reduce optional chaining.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants