Questions tagged [rethrow]

use for issues on rethrowing catch exception

In terms of exception handling, this refers to throwing the exception again.

73 questions
0
votes
0 answers

Passing Caught C# Exception as Parameter

Will Jon Skeet feed me to his pet unicorn if I do something like the following? private void TakeTheRisk() { try { ... DoRiskyBusiness(); ... } catch (SomeException ex) { …
Bondolin
  • 2,793
  • 7
  • 34
  • 62
0
votes
1 answer

try catch in method containing another method that throws an exception

I have a try-catch block in order to handle some methods' exceptions. This method contains other methods that might throw an exception, like in the example below: try{ MyMethod(...); }catch(MyException1){ // handle it... }catch(MyException2){ …
Elle
  • 305
  • 2
  • 10
0
votes
1 answer

ExecutorService that rethrows exceptions

I need to execute a task using any Executor or ExecutorService. The task (Callable or Runnable) is supposed to run infinitely, but in case of any exception it should be rethrown to the thread that submitted the task. I know that future.get() would…
Michal Kordas
  • 10,475
  • 7
  • 58
  • 103
0
votes
1 answer

how does rethrow exception terminate by outer catch?

enter code here `class Rethrow { public static void genException() { int n[]={4,8,16,32,64,128}; int d[]={2,0,8,0,4}; for(int i=0;i
Lalit kumar
  • 382
  • 4
  • 13
0
votes
2 answers

C++ re throw Exception gives error

I'm trying to catch a 'specific' exception (FormatException^ or OverflowException^) and then re throw it and catch it in the 'general' exception (Exception^) catch block. When run, I give it a format exception through input. I then get this error…
Evan Sevy
  • 659
  • 1
  • 13
  • 25
0
votes
1 answer

Mule rethrow exception from catchexception

How do exception can be rethrow from catch-exception-strategy in mule. Tried with below flows and after an exception from "flowdemo" errorhandling, it doesn't go to errorhandling of mdemoflow. it executes logger that is place after flow-ref.
0
votes
1 answer

ASP.NET MVC: Getting unhandled exception that stops in a catch block of a rethrow

I am seeing some strange behavior in my try/catch-rethrow code blocks. I have a method which instantiates a class of ClientGet and gets the Result value from that class. public Task Get(ClientRequest Request) { try { …
Xipooo
  • 1,496
  • 1
  • 14
  • 13
0
votes
0 answers

Intellij IDEA Java 7 Multi catch with rethrow Exception

the method below was compiled without any compilation Error on Eclipse Using JDK 7; Strangely the same method on Inellij IDEA 14 with the same JDK 7 produce a compilation error, but it Run! Is this due to a bad configuration on my IDEA? Thanks :) …
arammal
  • 393
  • 1
  • 4
  • 11
0
votes
1 answer

Rethrow an error from within SSIS package

Ive got a 2010 SSIS package which in turn runs other packages. Each package is independent so if one fails the others can still progress. My logic states the next one run on completion of the previous one wether it failed or not My proble is that…
ErickTreetops
  • 3,189
  • 4
  • 27
  • 37
0
votes
0 answers

Should System.Exception " is not a valid value for T" when converting an empty String be an InvalidCastException?

I've encountered this a few times, and it seems very wrong to me that .NET operations should throw a System.Exception instead of something more specific. Is there a reason why one shouldn't rethrow this specific instance as InvalidCastException? …
j.i.h.
  • 815
  • 8
  • 29
0
votes
3 answers

How to pass a thrown exception from a C# class to a C# Form

I have a project in c# which is split into UI layer and Business layer. Basically I have a form where you can select an account and input a number for deposit. Once you click the OK button, your DepositTransaction.cs will handle the…
Iuli
  • 121
  • 1
  • 4
  • 12
-1
votes
2 answers

throw checked exception as unchecked in java instead of wrapping

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 that means re-throwing is the hard part. Including…
D. Sikilai
  • 467
  • 1
  • 3
  • 17
-1
votes
1 answer

why c# continuewith pass exception?

I'm trying to handle task exceptions without await. I am trying to use ContinueWith with TaskContinuationOptions.NotOnRanToCompletion. But i have one main problem - in test program everything goes well and works only code from ContinueWith. But in…
1 2 3 4
5