You should stay away from catch (Exception) since that way you'll catch every possible exception. If you really only expect the IllegalArgumentException and handle that case you shouldn't broaden that scope; better add more catch blocks for other types of exceptions, then.