I have a class which throws a lot of exceptions:
try {
mapper.writeValue(outStream, myVal);
} catch (JsonGenerationException e) {
e.printStackTrace();
} catch (JsonMappingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
I think this looks messy. Is it ok to just catch a generic Exception
and not catch each individual exception if within the catch
clause of each exception I'm just printing the stack trace?