Adding getDocument
adding error code constants