Skip to content

Commit f538153

Browse files
committed
Added TooManyRequestsException to handle 429 response status code
1 parent 2778584 commit f538153

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Diff for: src/Plivo/Exception/PlivoTooManyRequestsException.cs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace Plivo.Exception
2+
{
3+
public class PlivoTooManyRequestsException : PlivoRestException
4+
{
5+
public PlivoTooManyRequestsException(string message, uint statusCode = 429) : base(message, statusCode)
6+
{
7+
}
8+
}
9+
}

Diff for: src/Plivo/Http/PlivoResponse.cs

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ private void ThrowException(string message)
9393
throw new PlivoNotFoundException(message);
9494
case 405:
9595
throw new PlivoRequestException(message);
96+
case 429:
97+
throw new PlivoTooManyRequestsException(message);
9698
case 500:
9799
throw new PlivoServerException(message);
98100
default:

0 commit comments

Comments
 (0)