What Happens when you try to read from a URL that doesn't exist?

i’m trying to read several files from a server using a URL object, some of them exist and some don’t. i’ve noticed that when i try to read a file that doesn’t exist, an exception isn’t thrown, but instead the program reads “junk”. is this normal behaviour?

How are you reading? Don’t know much about working with URL, but when you enter a URL in browser that dosen’t exist you get 404 error from server if you asked for something in existing domain. Maybe your app reads that?
Try it on domain that dosen’t exist, like www.ajoagagjiap.com, then you should get exception (if my logic is correct) since server dosen’t even exist.

I’m not sure why an exception isn’t thrown but try catching the FileNotFoundException, maybe the exception just isn’t being outputted.