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

fix: add missing "return" statements after errors #83

Merged
merged 5 commits into from
Aug 2, 2024

Conversation

brianphillips
Copy link
Contributor

@brianphillips brianphillips commented Aug 1, 2024

Description

When a route function returns an error early on in the function body (i.e. validating the presence of a field), it's important to not continue executing the function to ensure a) no undesired code is executed, and b) to avoid trying to emit headers multiple times.

Issue number: n/a

Type of change

  • New feature (non-breaking change which adds functionality)
  • Fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented
  • Changes generate no new warnings
  • PR title follows conventional commit semantics

If this is a breaking change 👇

  • I have documented the migration process
  • I have implemented necessary warnings (if it can live side by side)

Acknowledgement

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

t1agob and others added 4 commits July 23, 2024 23:16
Adding these early returns is necessary so that the request doesn't
continue executing the remainder of the function
@t1agob t1agob added the bug Something isn't working label Aug 2, 2024
@t1agob t1agob self-assigned this Aug 2, 2024
@t1agob t1agob changed the base branch from main to next August 2, 2024 20:45
Copy link
Contributor

@t1agob t1agob left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @brianphillips! This is now tested an approved.

@t1agob t1agob merged commit b41c118 into PagerDuty:next Aug 2, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants