So what's the right way to know if an error has occured when writing through a PrintWriter?
Asked
Active
Viewed 46 times
0
-
1your questions seems to be unclear to me. I hope you wanted to know what exceptions are thrown upon calling write(). As per (oracle docs)[http://docs.oracle.com/javase/7/docs/api/java/io/PrintWriter.html#write(int)] there are no exceptions throws – SpringLearner Oct 13 '16 at 09:03
-
@SpringLearner I think the question is *why* there are no exception throws and how to know if something went wrong. See the possible duplicate, it gives some reasons for this design. – Hexaholic Oct 13 '16 at 09:06
-
1@MarioJ.G. The questions are about the same topic but are different. The OP is asking what the right way around The printWriter never throwing an exception. The question you reference is about why such design is there in Java – Nyakiba Oct 13 '16 at 09:08
-
@Nyakiba The answer to this question is stated *in the duplicate question.* – user207421 Oct 13 '16 at 09:24
-
@EJP so one should search for answers to their questions in questions that aren't the same as their own??? – Nyakiba Oct 13 '16 at 09:27
-
@Nyakiba So this question is redundant because its answer is contained in another. There is no permanent value in leaving this question lying around. You seem to think that closing as a duplicate is to be construed as a punishment for failure to search. It isn't. It is just a necessary part of site cleansing. – user207421 Oct 13 '16 at 09:46