Graceful error handling and logging
Graceful error handling and logging

Right now a failed "copyr" will result in the error log being spammed with not really helpful error messages. Also situations such as `$dir` returning `false` are not really caught.

This adds more error handling and logging to make debugging such situations easier.

Signed-off-by: Lukas Reschke <65adda4326914576405c9e3a62f4904d96573863@statuscode.ch>

whitekiba/server,pmattern/server,andreas-p/nextcloud-server,xx621998xx/server,michaelletzgus/nextcloud-server,endsguy/server,Ardinis/server,whitekiba/server,Ardinis/server,whitekiba/server,andreas-p/nextcloud-server,Ardinis/server,xx621998xx/server,whitekiba/server,michaelletzgus/nextcloud-server,Ardinis/server,andreas-p/nextcloud-server,endsguy/server,pixelipo/server,pixelipo/server,jbicha/server,xx621998xx/server,jbicha/server,pixelipo/server,jbicha/server,andreas-p/nextcloud-server,nextcloud/server,xx621998xx/server,pmattern/server,nextcloud/server,michaelletzgus/nextcloud-server,jbicha/server,andreas-p/nextcloud-server,pixelipo/server,nextcloud/server,endsguy/server,pixelipo/server,pmattern/server,endsguy/server,pmattern/server,xx621998xx/server,pmattern/server,nextcloud/server,endsguy/server,whitekiba/server,jbicha/server,Ardinis/server,michaelletzgus/nextcloud-server