Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Plivo/Exceptions/PlivoResponseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function getErrorMessage()
/**
* Returns an exceptions with a message based on the status code
* @param string $message
* @return PlivoAuthenticationException|PlivoNotFoundException|PlivoRequestException|PlivoRestException|PlivoServerException|PlivoValidationException
* @return PlivoAuthenticationException|PlivoNotFoundException|PlivoRequestException|PlivoRestException|PlivoServerException|PlivoValidationException|PlivoTooManyRequestsException
*/
public function getException($message)
{
Expand Down Expand Up @@ -93,6 +93,13 @@ public function getException($message)
new PlivoRequestException(
"HTTP method used is not allowed to access resource");
break;
case 429:
return
$message?
new PlivoTooManyRequestsException($message):
new PlivoTooManyRequestsException(
"Too many requests");
break;
case 500:
return
$message?
Expand Down
14 changes: 14 additions & 0 deletions src/Plivo/Exceptions/PlivoTooManyRequestsException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Plivo\Exceptions;


/**
* Class PlivoTooManyRequestsException
* @package Plivo\Exceptions
*/

class PlivoTooManyRequestsException extends PlivoRestException
{

}