DOCS-1492 getLastError

Ready for merge.