Use return of exceptions, instead of implicitly throwing it (throw will be explicit)
Closed this issue · 5 comments
Exceptions/cpp/Platform.Exceptions/ThrowExtensions.h
Lines 3 to 9 in 6549e77
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."); }`
Sweep: do
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 team@sweep.dev.
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:
- Getting Sweep to run linters before committing! Check out Sweep Sandbox Configs to set it up.
- Added support for self-hosting! Check out Self-hosting Sweep to get started.
- [Self Hosting] Multiple options to compute vector embeddings, configure your .env file using VECTOR_EMBEDDING_SOURCE
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request.
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
Sweep: retry
Sweep: retry