From 814744d87eacb5e3293658aafc1b61f2d9674c71 Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 30 Jan 2007 16:56:29 +0000 Subject: [PATCH] Part of the fix for #1933 - give back a different error code in the case of a duplicate file. --- .../modules/archiveServer/var/xmlrpc/XR_Archive.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/campcaster/src/modules/archiveServer/var/xmlrpc/XR_Archive.php b/campcaster/src/modules/archiveServer/var/xmlrpc/XR_Archive.php index b848895c3..18d669643 100644 --- a/campcaster/src/modules/archiveServer/var/xmlrpc/XR_Archive.php +++ b/campcaster/src/modules/archiveServer/var/xmlrpc/XR_Archive.php @@ -95,11 +95,18 @@ class XR_Archive extends Archive { return $r; } $res = $this->uploadClose($r['token'], $r['trtype'], $r['pars']); - if (PEAR::isError($res)) - return new XML_RPC_Response(0, 803, + if (PEAR::isError($res)) { + $code = 803; + // Special case for duplicate file - give back + // different error code so we can display nice user message. + if ($res->getCode() == GBERR_GUNID) { + $code = 888; + } + return new XML_RPC_Response(0, $code, "xr_uploadClose: ".$res->getMessage(). " ".$res->getUserInfo() ); + } return new XML_RPC_Response(XML_RPC_encode($res)); }