From the way your question is phrased, it sounds like you're generically asking if you should verify something executed correctly. The answer is yes.
If it's something simple like a system call, then you would return the runtime's exit code
For example:
Runtime.exitValue()
This is assuming whatever you executed itself returns a proper error. If I run a Bash script from Linux and it returns 2, your Java code needs to know what that means and what to do.
In Java the big things to catch are Exceptions (and NOT just catching them as generic exceptions). ArithmeticException (dividing by 0), ArrayOutOfBounds (accessing part of an array that isn't defined), NullPointer, etc. Whenever you run into unexpected or risky behavior, it's always safer to catch yourself.
The extent to which you verify as you go varies on your development environment.
bool UploadFile
should be named tobool tryUploadFile
so that it indicates you can't be sure after execution that the file was uploaded. You need to check yourself if you care regarding the success. If the second one is calledvoid UploadFile
it must fulfill its contract when beeing called. This means, the file must be uploaded. If the function fails to upload (e.g. no notwork connection available) it broke its contract - so the only way out is throwing an exception.