Skip to content

Commit 9cb43c2

Browse files
committed
Update error handling by accepting 403 and 404
1 parent aaf9aad commit 9cb43c2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Dropbox.Api/ApiException.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//-----------------------------------------------------------------------------
1+
//-----------------------------------------------------------------------------
22
// <copyright file="ApiException.cs" company="Dropbox Inc">
33
// Copyright (c) Dropbox Inc. All rights reserved.
44
// </copyright>
@@ -88,7 +88,7 @@ ApiException<TError> IEncodable<ApiException<TError>>.Decode(IDecoder decoder)
8888
{
8989
using (var obj = decoder.GetObject())
9090
{
91-
this.ErrorResponse = obj.GetFieldObject<TError>("reason");
91+
this.ErrorResponse = obj.GetFieldObject<TError>("error");
9292
}
9393

9494
return this;

Dropbox.Api/DropboxClient.common.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,9 @@ private async Task<Result> RequestJsonString(
447447
{
448448
throw new RetryException(429, uri: uri, isRateLimit: true);
449449
}
450-
else if (response.StatusCode == HttpStatusCode.Conflict)
450+
else if (response.StatusCode == HttpStatusCode.Conflict ||
451+
response.StatusCode == HttpStatusCode.Forbidden ||
452+
response.StatusCode == HttpStatusCode.NotFound)
451453
{
452454
var reason = await response.Content.ReadAsStringAsync();
453455

0 commit comments

Comments
 (0)