check for document.error.code