Error manager v78

Submit a new pull request based on last review comments.
Fix the currentURL issue and several unknown errors.