From 070a4a8399201150a633c80608a13cc44781a3c4 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 30 Apr 2019 20:00:42 +0800 Subject: Throw exception in cos service. --- Timeline/Services/QCloudCosService.cs | 3 ++- Timeline/Services/UserService.cs | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'Timeline/Services') 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 /// The url if user exists. Null if user does not exist. Task GetAvatarUrl(string username); + /// + /// Put a avatar of a user. + /// + /// The name of user. + /// The data of avatar image. + /// The mime type of the image. + /// Return if success. + /// Return if user does not exist. Task PutAvatar(string username, byte[] data, string mimeType); } -- cgit v1.2.3