aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-04-30 20:00:42 +0800
committercrupest <crupest@outlook.com>2019-04-30 20:00:42 +0800
commita04bcb5971872e7dbc079de9337875e73f7642dc (patch)
tree37c2b6f9dcb3d6f57867ebc7538523d1a338183d
parent484f59f9c954fdced635c24c5ab49840c3022d93 (diff)
downloadtimeline-a04bcb5971872e7dbc079de9337875e73f7642dc.tar.gz
timeline-a04bcb5971872e7dbc079de9337875e73f7642dc.tar.bz2
timeline-a04bcb5971872e7dbc079de9337875e73f7642dc.zip
Throw exception in cos service.
-rw-r--r--Timeline/Services/QCloudCosService.cs3
-rw-r--r--Timeline/Services/UserService.cs8
2 files changed, 10 insertions, 1 deletions
diff --git a/Timeline/Services/QCloudCosService.cs b/Timeline/Services/QCloudCosService.cs
index 078dd37b..b37631e5 100644
--- a/Timeline/Services/QCloudCosService.cs
+++ b/Timeline/Services/QCloudCosService.cs
@@ -234,7 +234,7 @@ namespace Timeline.Services
catch (Exception e)
{
_logger.LogError(e, "An error occured when test a cos object existence.");
- return false;
+ throw;
}
}
@@ -297,6 +297,7 @@ namespace Timeline.Services
catch (Exception e)
{
_logger.LogError(e, "An error occured when test a cos object existence.");
+ throw;
}
}
diff --git a/Timeline/Services/UserService.cs b/Timeline/Services/UserService.cs
index 9ebf2668..8ab3bc54 100644
--- a/Timeline/Services/UserService.cs
+++ b/Timeline/Services/UserService.cs
@@ -161,6 +161,14 @@ namespace Timeline.Services
/// <returns>The url if user exists. Null if user does not exist.</returns>
Task<string> GetAvatarUrl(string username);
+ /// <summary>
+ /// Put a avatar of a user.
+ /// </summary>
+ /// <param name="username">The name of user.</param>
+ /// <param name="data">The data of avatar image.</param>
+ /// <param name="mimeType">The mime type of the image.</param>
+ /// <returns>Return <see cref="PutAvatarResult.Success"/> if success.
+ /// Return <see cref="PutAvatarResult.UserNotExists"/> if user does not exist.</returns>
Task<PutAvatarResult> PutAvatar(string username, byte[] data, string mimeType);
}