From 88bf8fa7046e13b4ef3a8309f3f8e748f6731ac3 Mon Sep 17 00:00:00 2001 From: Florian Schlichting Date: Wed, 4 Oct 2017 22:30:59 +0200 Subject: [PATCH] PUT: actually propagate database error to client (fix: #127) --- inc/caldav-PUT-default.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inc/caldav-PUT-default.php b/inc/caldav-PUT-default.php index d291acb3..17b0e48c 100644 --- a/inc/caldav-PUT-default.php +++ b/inc/caldav-PUT-default.php @@ -93,8 +93,10 @@ $qry->QDo( $sql, $params ); $qry->QDo("SELECT write_sync_change( $collection_id, $response_code, :dav_name)", array(':dav_name' => $dest->bound_from() ) ); -$qry = new AwlQuery('COMMIT'); -if ( !$qry->Exec('move') ) rollback(500); +if ( !$qry->Exec('COMMIT') ) { + $qry->Rollback(); + $response_code = 500; +} // Uncache anything to do with the collection $cache = getCacheInstance();