Вопрос

this is the error log that i get when i put Log.e in my catch,but i don't know what causes the error to occur.

try{
   ...
}
catch(IOException e ){
   Log.e("MY_APP_error!", "Error!", e);
}

here is the result of the my logcat

04-06 09:12:28.698: E/MY_APP_error!(4825): Error!
04-06 09:12:28.698: E/MY_APP_error!(4825): java.io.EOFException
04-06 09:12:28.698: E/MY_APP_error!(4825):  at libcore.io.Streams.readAsciiLine(Streams.java:203)
04-06 09:12:28.698: E/MY_APP_error!(4825):  at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:579)
04-06 09:12:28.698: E/MY_APP_error!(4825):  at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:827)
04-06 09:12:28.698: E/MY_APP_error!(4825):  at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
04-06 09:12:28.698: E/MY_APP_error!(4825):  at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:177)
04-06 09:12:28.698: E/MY_APP_error!(4825):  at com.example.logintest.adduser$AssCrounTask.doInBackground(adduser.java:111)
04-06 09:12:28.698: E/MY_APP_error!(4825):  at com.example.logintest.adduser$AssCrounTask.doInBackground(adduser.java:1)
04-06 09:12:28.698: E/MY_APP_error!(4825):  at android.os.AsyncTask$2.call(AsyncTask.java:287)
04-06 09:12:28.698: E/MY_APP_error!(4825):  at java.util.concurrent.FutureTask.run(FutureTask.java:234)
04-06 09:12:28.698: E/MY_APP_error!(4825):  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
04-06 09:12:28.698: E/MY_APP_error!(4825):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
04-06 09:12:28.698: E/MY_APP_error!(4825):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
04-06 09:12:28.698: E/MY_APP_error!(4825):  at java.lang.Thread.run(Thread.java:841)
Это было полезно?

Решение

The exception EOFException (End Of File!) is throw when the reading (from a file or stream too) is finished.

You can ignore this exception if your code is OK with the fact it finished the reading (should, because it's obvious the file will finish)

public class EOFException extends IOException

Signals that an end of file or end of stream has been reached unexpectedly during input.

This exception is mainly used by data input streams to signal end of stream. Note that many other input operations

In your specific case, refer to the fact it finished to download a http request (a web page? more code if you need help)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top