Merge "Better error reporting for createOrUpdateLayer" into pi-dev