• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is causal Exception?  RSS feed

 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May someone describe causal Exception and how deal with it?
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you provide the context where you read this rather incomprehensible expression?
 
Hunter McMillen
Ranch Hand
Posts: 492
Firefox Browser Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
causal implies cause, but I'm not sure if you mean what is causing the exception? or asking if the exception causes something to happen?

Hunter
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I googled for the phrase and found a few examples, mostly from people who didn't appear to be native English speakers. That's why I asked for the context, because although "causal" is an English word, you wouldn't normally describe a Java exception as "causal" in English.
 
Mike Simmons
Ranch Hand
Posts: 3090
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was thinking it might possibly a reference to the exception (Throwable) that can be returned by getCause(). But it's probably better to wait for the original poster to tell us where he heard the term. Otherwise we could run off on irrelevant tangents.
 
Greg Charles
Sheriff
Posts: 3015
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
+1 with Mike. What else could it possibly mean? It's more common to call it a nested exception, but you do see it in stack traces under "Caused by:".

As far as how to deal with it, it would be rare to look into the "causal" exception except as a post mortem. That is, you look into the logs to figure out why something failed. Before we had nested exceptions, an exception handler that caught an exception, maybe logged something cryptic, and then threw its own exception would completely obscure the underlying cause.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66306
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At first I saw "casual" and figured it was an exception without a tie.

Seriously, especially in the web world, it's common to wrap an exception as the cause of a higher level exception such as ServletException or JspException for throwing higher in the chain. The original exception can be thought of as the "causal exception" although that's not a term that's often bandied about.
 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This the resource of causal Exception

http://books.google.com/books?id=fu5HtixRje8C&pg=PA112&lpg=PA112&dq=throw+new+Exception(+"Here's+the+story...",+causalException+);&source=bl&ots=nHUC1v4tvv&sig=A0K7scRGG2mL4HMbsElzOu67ues&hl=en&ei=uQZdTOKAN4_80wTLqPDABw&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBIQ6AEwAA#v=onepage&q=throw%20new%20Exception(%20%22Here's%20the%20story...%22%2C%20causalException%20)%3B&f=false

and about English language and native language and so on...:

This is the resume of one of the writers:

http://pat.net/resume/

As friends see, The language of Pat Niemeyer is English.

But this is not English class,

May someone give me a simple example of causal Exception please? I need more information.

Thanks in advance .
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You already have an example in the book page you quoted.

Please explain what you don't understand.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!