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

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

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

javascript - Chart.js - setting tooltip z-index -