Skip to content

Commit

Permalink
Merge pull request #15 from CircleOfNice/errorCodeMapping
Browse files Browse the repository at this point in the history
Version 0.2-dev: ErrorCodeMapping
  • Loading branch information
TobiasHauck committed May 6, 2015
2 parents ca7dc3b + f419bfd commit 08408b0
Show file tree
Hide file tree
Showing 84 changed files with 4,229 additions and 6 deletions.
49 changes: 49 additions & 0 deletions Exceptions/AbortedByCallbackException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* This file is part of CiRestClientBundle.
*
* CiRestClientBundle is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CiRestClientBundle is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CiRestClientBundle. If not, see <http://www.gnu.org/licenses/>.
*/

namespace Ci\RestClientBundle\Exceptions;

use Ci\RestClientBundle\Exceptions\Interfaces\DetailedExceptionInterface;

/**
* Specific exception for curl requests
*
* Explanations given in function getDetailedMessage
*
* @author Tobias Hauck <[email protected]>
* @copyright 2015 TeeAge-Beatz UG
*/
class AbortedByCallbackException extends CurlException implements DetailedExceptionInterface {

/**
* Sets all necessary dependencies
*/
public function __construct() {
$message = 'Aborted by callback. A callback returned "abort" to libcurl.';
$code = 42;
parent::__construct($message, $code);
}

/**
* {@inheritdoc}
* @codeCoverageIgnore
*/
public function getDetailedMessage() {
return 'Aborted by callback. A callback returned "abort" to libcurl.';
}
}
50 changes: 50 additions & 0 deletions Exceptions/AgainException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php
/**
* This file is part of CiRestClientBundle.
*
* CiRestClientBundle is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CiRestClientBundle is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CiRestClientBundle. If not, see <http://www.gnu.org/licenses/>.
*/

namespace Ci\RestClientBundle\Exceptions;

use Ci\RestClientBundle\Exceptions\Interfaces\DetailedExceptionInterface;

/**
* Specific exception for curl requests
*
* Explanations given in function getDetailedMessage
*
* @author Tobias Hauck <[email protected]>
* @copyright 2015 TeeAge-Beatz UG
*/
class AgainException extends CurlException implements DetailedExceptionInterface {

/**
* Sets all necessary dependencies
*/
public function __construct() {
$message = 'Socket is not ready for send/recv wait till it\'s ready and try again. This return code is only returned from curl_easy_recv and curl_easy_send';
$code = 81;
parent::__construct($message, $code);
}

/**
* {@inheritdoc}
* @codeCoverageIgnore
*/
public function getDetailedMessage() {
return 'Socket is not ready for send/recv wait till it\'s ready and try again. ' .
'This return code is only returned from curl_easy_recv and curl_easy_send.';
}
}
49 changes: 49 additions & 0 deletions Exceptions/BadContentEncodingException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* This file is part of CiRestClientBundle.
*
* CiRestClientBundle is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CiRestClientBundle is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CiRestClientBundle. If not, see <http://www.gnu.org/licenses/>.
*/

namespace Ci\RestClientBundle\Exceptions;

use Ci\RestClientBundle\Exceptions\Interfaces\DetailedExceptionInterface;

/**
* Specific exception for curl requests
*
* Explanations given in function getDetailedMessage
*
* @author Tobias Hauck <[email protected]>
* @copyright 2015 TeeAge-Beatz UG
*/
class BadContentEncodingException extends CurlException implements DetailedExceptionInterface {

/**
* Sets all necessary dependencies
*/
public function __construct() {
$message = 'Unrecognized transfer encoding';
$code = 61;
parent::__construct($message, $code);
}

/**
* {@inheritdoc}
* @codeCoverageIgnore
*/
public function getDetailedMessage() {
return 'Unrecognized transfer encoding.';
}
}
49 changes: 49 additions & 0 deletions Exceptions/BadDownloadResumeException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* This file is part of CiRestClientBundle.
*
* CiRestClientBundle is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CiRestClientBundle is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CiRestClientBundle. If not, see <http://www.gnu.org/licenses/>.
*/

namespace Ci\RestClientBundle\Exceptions;

use Ci\RestClientBundle\Exceptions\Interfaces\DetailedExceptionInterface;

/**
* Specific exception for curl requests
*
* Explanations given in function getDetailedMessage
*
* @author Tobias Hauck <[email protected]>
* @copyright 2015 TeeAge-Beatz UG
*/
class BadDownloadResumeException extends CurlException implements DetailedExceptionInterface {

/**
* Sets all necessary dependencies
*/
public function __construct() {
$message = 'The download could not be resumed because the specified offset was out of the file boundary.';
$code = 36;
parent::__construct($message, $code);
}

/**
* {@inheritdoc}
* @codeCoverageIgnore
*/
public function getDetailedMessage() {
return 'The download could not be resumed because the specified offset was out of the file boundary.';
}
}
49 changes: 49 additions & 0 deletions Exceptions/BadFunctionArgumentException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* This file is part of CiRestClientBundle.
*
* CiRestClientBundle is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CiRestClientBundle is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CiRestClientBundle. If not, see <http://www.gnu.org/licenses/>.
*/

namespace Ci\RestClientBundle\Exceptions;

use Ci\RestClientBundle\Exceptions\Interfaces\DetailedExceptionInterface;

/**
* Specific exception for curl requests
*
* Explanations given in function getDetailedMessage
*
* @author Tobias Hauck <[email protected]>
* @copyright 2015 TeeAge-Beatz UG
*/
class BadFunctionArgumentException extends CurlException implements DetailedExceptionInterface {

/**
* Sets all necessary dependencies
*/
public function __construct() {
$message = 'Internal error. A function was called with a bad parameter.';
$code = 43;
parent::__construct($message, $code);
}

/**
* {@inheritdoc}
* @codeCoverageIgnore
*/
public function getDetailedMessage() {
return 'Internal error. A function was called with a bad parameter.';
}
}
49 changes: 49 additions & 0 deletions Exceptions/ChunkFailedException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* This file is part of CiRestClientBundle.
*
* CiRestClientBundle is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CiRestClientBundle is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CiRestClientBundle. If not, see <http://www.gnu.org/licenses/>.
*/

namespace Ci\RestClientBundle\Exceptions;

use Ci\RestClientBundle\Exceptions\Interfaces\DetailedExceptionInterface;

/**
* Specific exception for curl requests
*
* Explanations given in function getDetailedMessage
*
* @author Tobias Hauck <[email protected]>
* @copyright 2015 TeeAge-Beatz UG
*/
class ChunkFailedException extends CurlException implements DetailedExceptionInterface {

/**
* Sets all necessary dependencies
*/
public function __construct() {
$message = 'Chunk callback reported error';
$code = 88;
parent::__construct($message, $code);
}

/**
* {@inheritdoc}
* @codeCoverageIgnore
*/
public function getDetailedMessage() {
return 'Chunk callback reported error.';
}
}
49 changes: 49 additions & 0 deletions Exceptions/ConvFailedException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* This file is part of CiRestClientBundle.
*
* CiRestClientBundle is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CiRestClientBundle is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CiRestClientBundle. If not, see <http://www.gnu.org/licenses/>.
*/

namespace Ci\RestClientBundle\Exceptions;

use Ci\RestClientBundle\Exceptions\Interfaces\DetailedExceptionInterface;

/**
* Specific exception for curl requests
*
* Explanations given in function getDetailedMessage
*
* @author Tobias Hauck <[email protected]>
* @copyright 2015 TeeAge-Beatz UG
*/
class ConvFailedException extends CurlException implements DetailedExceptionInterface {

/**
* Sets all necessary dependencies
*/
public function __construct() {
$message = 'Character conversion failed';
$code = 75;
parent::__construct($message, $code);
}

/**
* {@inheritdoc}
* @codeCoverageIgnore
*/
public function getDetailedMessage() {
return 'Character conversion failed.';
}
}
Loading

0 comments on commit 08408b0

Please sign in to comment.