Add support for `.treeDir` property on error objects