java - How to use chained exceptions -


in application have never used chained exception. looking forward use believe can make code better. being new can provide me example in type of scenario , how can used?

from docs directly

the following example shows how use chained exception.

try {  } catch (ioexception e) {     throw new sampleexception("other ioexception", e); } 

in example, when ioexception caught, new sampleexception exception created original cause attached , chain of exceptions thrown next higher level exception handler.


Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -