aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Controllers/UserAvatarController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-03-06 22:28:32 +0800
committercrupest <crupest@outlook.com>2020-03-06 22:28:32 +0800
commit99cf6981e7528b8e53f73ba91a7d6a0cf01f3a1f (patch)
treef7a5aee626f4771a0c75ddc67c0b13b67c472a10 /Timeline/Controllers/UserAvatarController.cs
parenta37874830399c193392cc78367efcecbe8275ceb (diff)
downloadtimeline-99cf6981e7528b8e53f73ba91a7d6a0cf01f3a1f.tar.gz
timeline-99cf6981e7528b8e53f73ba91a7d6a0cf01f3a1f.tar.bz2
timeline-99cf6981e7528b8e53f73ba91a7d6a0cf01f3a1f.zip
Init development of post image feature.
Diffstat (limited to 'Timeline/Controllers/UserAvatarController.cs')
-rw-r--r--Timeline/Controllers/UserAvatarController.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Timeline/Controllers/UserAvatarController.cs b/Timeline/Controllers/UserAvatarController.cs
index 2dd279a8..f4f3db3e 100644
--- a/Timeline/Controllers/UserAvatarController.cs
+++ b/Timeline/Controllers/UserAvatarController.cs
@@ -126,14 +126,14 @@ namespace Timeline.Controllers
("Username", username), ("Mime Type", Request.ContentType)));
return Ok();
}
- catch (AvatarFormatException e)
+ catch (ImageException e)
{
_logger.LogInformation(e, Log.Format(LogPutUserBadFormat, ("Username", username)));
return BadRequest(e.Error switch
{
- AvatarFormatException.ErrorReason.CantDecode => ErrorResponse.UserAvatar.BadFormat_CantDecode(),
- AvatarFormatException.ErrorReason.UnmatchedFormat => ErrorResponse.UserAvatar.BadFormat_UnmatchedFormat(),
- AvatarFormatException.ErrorReason.BadSize => ErrorResponse.UserAvatar.BadFormat_BadSize(),
+ ImageException.ErrorReason.CantDecode => ErrorResponse.UserAvatar.BadFormat_CantDecode(),
+ ImageException.ErrorReason.UnmatchedFormat => ErrorResponse.UserAvatar.BadFormat_UnmatchedFormat(),
+ ImageException.ErrorReason.NotSquare => ErrorResponse.UserAvatar.BadFormat_BadSize(),
_ =>
throw new Exception(ExceptionUnknownAvatarFormatError)
});