Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHONUM-3795 #345

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
{

}
Loading