refactor(sub-gen): Refactor error handling when writing resource roots from the component sub-generator

Fixes #54 #55