try { fooService.handleFoo(foo, bar); } catch (FooCreationException e) { log.add(e.getMessage()); } catch (FooNotFoundException e) { log.add(e.getMessage()); } catch (ManagerException e) { log.add(e.getMessage()); } catch (Exception e) { log.add(e.getMessage()); }
Here the exception type is lost and only the error message is kept.
No comments:
Post a Comment