Your issues sound like general exception - handling issues. Have you considered using the try...catch statement to determine if the number is not positive? You can also use this to determine if the number is between 1000 and 9999.
Remember, try...catch statements should always go from most specific to most general. This is because if you catch the most general exception first, it will account for all of the exceptions, making it harder to understand what the specific error is. This will also enable you to display a 0.
You should be able to code the user input request in the try block and the exceptions afterwards.
Good luck and let me know if you solve it