Better error handling; updated comments; updated example

Added completeError() for un-handled exceptions and cases like immediate + force prompt; Refactored the code/comments for better readability.