I am trying to learn trough example on a proper way to handle exceptions. When should I catch it, when and how should I throw it further down the line ?In this example I have a very simple setup:MainMethodExceptionHandler // Here is where I'd like to catch and resolve most exceptionsExceptionGenerator // Errors start from herepublic List<String> readFile(String pathStr) throws InvalidPathException, IOException {    Path path = Paths.get(Repository.fixPath(pathStr));         // This can throw both FileNotFoundException and InvalidPathException, I think. It should!    List<String> fileContent;    try {        fileContent = Files.readAllLines(path, StandardCharsets.UTF_8);        return fileContent;    } catch (IOException e) {        throw new IOException(Could not read file content);    }}// FileNotFoundException (FNFE) should be sent to the previous methodprivate static String fixPath(String path) throws FileNotFoundException {    if (path.isEmpty() || path == null)         throw new FileNotFoundException();    ...    return path;}Points of interest:Should my readFiles method catch the FileNotFoundException thrown by the second method ? Should I then throw it again, like with the IOException ? How does the message exactly work (the parameter for the exception)? Is it actually usable in any way except printing it out ?If I have IOException (it supersedes the FNFE, can I still throw the FNFE then just catch FNFE first, and IOE second?) 
Proper propagation / handling of exceptions
java;exception handling
catch (IOException e) {    throw new IOException(Could not read file content);}This is a very bad practise because you are losing all the stacktrace of e ! Therefore when catching this exception you won't have any information of the root cause of the exception.If you really need to add a specific message at this layer, consider doing it like this: throw new IOException(Could not read file content, e);What readFile must throw ? It depends on the verbosity you want to expose.Verbose casepublic List<String> readFile(String pathStr) throws FileNotFoundException, IOException { }This case is appropriate when you want to indicate to the caller that the exceptions throwed by this method should be handled differently.Less verbose casepublic List<String> readFile(String pathStr) throws IOException { }This case is appropriate when you don't want to bother with the details of the exception (just knowing something went wrong is enough).