Stop publishing on duplicate page

This commit is contained in:
Stéphane Goetz 2016-01-25 14:47:37 +01:00
parent ef5dc8ea52
commit 74b11f6c7b
2 changed files with 10 additions and 0 deletions

View File

@ -69,6 +69,10 @@ class Api
$message .= (string) $response->getBody();
}
if ($level == '4' && strpos($message, "page with this title already exists") !== false) {
return new DuplicateTitleException($message, 0, $e->getPrevious());
}
return new BadResponseException($message, $request, $response, $e->getPrevious());
}

View File

@ -0,0 +1,6 @@
<?php namespace Todaymade\Daux\Format\Confluence;
class DuplicateTitleException extends \RuntimeException
{
}