If there's an error, the output at the command promt gives a reason. User not connected, User does not exist, etc... I was trying to figure out a way to make the browser display that error. instead it just gave numbers. but i figured it out.
0 = OK
256 = Not Connected
For anything else it doesn't do anything. so i made a script that works with that.