Skip to main content
5 votes
2 answers
411 views

In my code, I have something like: try { do_stuff(); } catch(my_exception_class& e) { if (not can_ignore_exception(e)) { throw e; } log_or_do_nothing(e); } A static analyzer (...
einpoklum's user avatar
  • 140k
113 votes
2 answers
27k views

After searching for some references to figure it out, -unfortunately- I could not find useful -and simple- description about understanding the differences between throws and rethrows. It is kind of ...
Ahmad F's user avatar
  • 31.8k
311 votes
11 answers
197k views

What are the best practices to consider when catching exceptions and re-throwing them? I want to make sure that the Exception object's InnerException and stack trace are preserved. Is there a ...
Seibar's user avatar
  • 70.7k
144 votes
5 answers
94k views

Will the following append() in the catch cause the rethrown exception to see the effect of append() being called? try { mayThrowMyErr(); } catch (myErr &err) { err.append("Add to my message ...
WilliamKF's user avatar
  • 43.7k
67 votes
3 answers
104k views

I'm learning to use python. I just came across this article: http://nedbatchelder.com/blog/200711/rethrowing_exceptions_in_python.html It describes rethrowing exceptions in python, like this: try: ...
Bosiwow's user avatar
  • 2,263
43 votes
12 answers
8k views

I rethrow an exception with "throw;", but the stacktrace is incorrect: static void Main(string[] args) { try { try { throw new Exception("Test"); //Line 12 } ...
Floyd's user avatar
  • 1,928
5 votes
1 answer
2k views

I'm flabbergasted. I always thought that throw by itself in a catch block would throw the exception at hand without altering the stack trace, but that throw ex in a catch block would alter the stack ...
Stephan G's user avatar
  • 3,527
3 votes
1 answer
1k views

I'm trying to use the library livekit_client to create a chat room, I'm trying to handle the exception when the connection fails, this is the code I'm using to connect and catch the error: try { ...
MOHAMMAD RASIM's user avatar
1 vote
1 answer
1k views

I have a class that is derived from another class. I want to be able to catch and re-throw the exception(s) thrown by the derived class's constructor in my derived class's constructor. There seems to ...
fakl's user avatar
  • 127
0 votes
5 answers
1k views

I've made class model of places, and I want to show the logo of each place, I add the image location folder in class named place_model.dart and this is the code for place_model.dart : class Place{ ...
Jesselyn Firesta's user avatar
6 votes
1 answer
236 views

When running the following code, I see the memory consumption of the process grow. Is there a memory leak in my code, is there a memory leak in the std implementation, or is it intended behaviour? It'...
Philipp B.'s user avatar
1 vote
0 answers
2k views

Why first case prints : "second level catch" "top level catch" and second case prints: only "second level catch"? Difference in finally block. Future<void> main() ...
Андрей's user avatar
-1 votes
2 answers
2k views

I have the following code and i need to scan the Exception thrown. If it satisfies a particular condition i ignore the exception. Else i re-throw. The exception being thrown is a checked exception ...
D. Sikilai's user avatar
20 votes
6 answers
7k views

I thought throwing an exception is good practice to let it bubble back up to the UI or somewhere where you log the exception and notify the user about it. Why does resharper say it is redundant? try ...
orandov's user avatar
  • 3,306
0 votes
0 answers
52 views

I have confusing (lack of comprehension) trying to translate some part of my code to Optional on Java 8. First example mock Code private void privateMethodOne(CustomRequesDto customRequesDto) { ...
joseluisbz's user avatar
  • 1,716

15 30 50 per page
1
2 3 4 5