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

Use return of exceptions, instead of implicitly throwing it (throw will be explicit) #72

Closed
1 task done
Konard opened this issue Mar 15, 2022 · 5 comments
Closed
1 task done
Labels

Comments

@Konard
Copy link
Member

Konard commented Mar 15, 2022

void NotSupportedException() { throw std::logic_error("Not supported exception."); }
auto NotSupportedExceptionAndReturn() { throw std::logic_error("Not supported exception."); }
void NotImplementedException() { throw std::logic_error("Not implemented exception."); }
auto NotImplementedExceptionAndReturn() { throw std::logic_error("Not implemented exception."); }

replace with:

auto NotSupportedException() { return std::logic_error("Not supported exception."); }

auto NotImplementedException() { return std::logic_error("Not implemented exception."); }

use:

throw NotSupportedException();
Checklist
  • cpp/Platform.Exceptions/ThrowExtensions.h ❌ Failed
• Replace the `throw` keyword with `return` in the `NotSupportedException` function definition. The modified function should look like this: `auto NotSupportedException() { return std::logic_error("Not supported exception."); }` • Replace the `throw` keyword with `return` in the `NotImplementedException` function definition. The modified function should look like this: `auto NotImplementedException() { return std::logic_error("Not implemented exception."); }`
@FreePhoenix888
Copy link
Member

Sweep: do

@linksplatform-sweepai
Copy link

linksplatform-sweepai bot commented Sep 20, 2023

Sweeping

50%


Actions (click)

  • ↻ Restart Sweep

❌ Unable to Complete PR

I'm sorry, but it looks like an error has occurred. Try changing the issue description to re-trigger Sweep. If this error persists contact [email protected].

For bonus GPT-4 tickets, please report this bug on Discord.


Please look at the generated plan. If something looks wrong, please add more details to your issue.

File Path Proposed Changes
cpp/Platform.Exceptions/ThrowExtensions.h Modify cpp/Platform.Exceptions/ThrowExtensions.h with contents:
• Replace the throw keyword with return in the NotSupportedException function definition. The modified function should look like this: auto NotSupportedException() { return std::logic_error("Not supported exception."); }
• Replace the throw keyword with return in the NotImplementedException function definition. The modified function should look like this: auto NotImplementedException() { return std::logic_error("Not implemented exception."); }

🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request.

@FreePhoenix888
Copy link
Member

Sweep: in cpp/Platform.Exceptions/ThrowExtensions.h we have code like this:

 void NotSupportedException() { throw std::logic_error("Not supported exception."); } 
  
 auto NotSupportedExceptionAndReturn() { throw std::logic_error("Not supported exception."); } 

Replace throw word in such functions to return

@FreePhoenix888
Copy link
Member

Sweep: retry

@FreePhoenix888
Copy link
Member

Sweep: retry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants