Skip to content
Merged
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
4 changes: 2 additions & 2 deletions src/Twilio/Clients/BearerToken/TwilioOrgsTokenRestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#endif

using Twilio.Http;
using Twilio.Http.BearerToken;

Check warning on line 17 in src/Twilio/Clients/BearerToken/TwilioOrgsTokenRestClient.cs

View workflow job for this annotation

GitHub Actions / Test

The using directive for 'Twilio.Http.BearerToken' appeared previously in this namespace

Check warning on line 17 in src/Twilio/Clients/BearerToken/TwilioOrgsTokenRestClient.cs

View workflow job for this annotation

GitHub Actions / Test

The using directive for 'Twilio.Http.BearerToken' appeared previously in this namespace
#if NET35
using Twilio.Http.Net35;
using System.Collections.Generic;
Expand Down Expand Up @@ -209,7 +209,7 @@
var handler = new JwtSecurityTokenHandler();
try{
var jwtToken = handler.ReadJwtToken(token);
var exp = jwtToken.Payload.Exp;

Check warning on line 212 in src/Twilio/Clients/BearerToken/TwilioOrgsTokenRestClient.cs

View workflow job for this annotation

GitHub Actions / Test

'JwtPayload.Exp' is obsolete: '`int? JwtPayload.Exp` is deprecated and will be removed in a future release. Use `long? JwtPayload.Expiration` instead. For more information, see https://aka.ms/IdentityModel/7-breaking-changes'

Check warning on line 212 in src/Twilio/Clients/BearerToken/TwilioOrgsTokenRestClient.cs

View workflow job for this annotation

GitHub Actions / Test

'JwtPayload.Exp' is obsolete: '`int? JwtPayload.Exp` is deprecated and will be removed in a future release. Use `long? JwtPayload.Expiration` instead. For more information, see https://aka.ms/IdentityModel/7-breaking-changes'
if (exp.HasValue)
{
var expirationDate = DateTimeOffset.FromUnixTimeSeconds(exp.Value).UtcDateTime;
Expand Down Expand Up @@ -293,7 +293,7 @@
{
restException = RestException.FromJson(response.Content);
}
catch (JsonReaderException) { /* Allow null check below to handle */ }
catch (JsonException) { /* Allow null check below to handle */ }

if (restException != null)
{
Expand All @@ -312,7 +312,7 @@
{
restApiStandardException = RestApiStandardException.FromJson(response.Content);
}
catch (JsonReaderException) { /* Allow fallback to legacy format */ }
catch (JsonException) { /* Allow fallback to legacy format */ }

if (restApiStandardException != null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Twilio/Clients/NoAuth/TwilioNoAuthRestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private static Response ProcessResponse(Response response)
{
restException = RestException.FromJson(response.Content);
}
catch (JsonReaderException) { /* Allow null check below to handle */ }
catch (JsonException) { /* Allow null check below to handle */ }


if (restException != null)
Expand All @@ -192,7 +192,7 @@ private static Response ProcessResponse(Response response)
{
restApiStandardException = RestApiStandardException.FromJson(response.Content);
}
catch (JsonReaderException) { /* Allow fallback to legacy format */ }
catch (JsonException) { /* Allow fallback to legacy format */ }

// Check if it's a valid RFC 9457 response (has 'type' field)
if (restApiStandardException != null)
Expand Down
6 changes: 3 additions & 3 deletions src/Twilio/Clients/TwilioRestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private static Response ProcessResponse(Response response)
{
restException = RestException.FromJson(response.Content);
}
catch (JsonReaderException) { /* Allow null check below to handle */ }
catch (JsonException) { /* Allow null check below to handle */ }

if (restException != null)
{
Expand All @@ -245,14 +245,14 @@ private static Response ProcessResponse(Response response)
);
}


// Try to deserialize as RFC 9457 format first (RestApiStandardException)
RestApiStandardException restApiStandardException = null;
try
{
restApiStandardException = RestApiStandardException.FromJson(response.Content);
}
catch (JsonReaderException) { /* Allow fallback to legacy format */ }
catch (JsonException) { /* Allow fallback to legacy format */ }

// Check if it's a valid RFC 9457 response (has 'type' field)
if (restApiStandardException != null)
Expand Down
Loading