about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorSumit Khanna <notify@battlepenguin.com>2018-12-13 22:07:21 -0600
committerEugen Rochko <eugen@zeonfederated.com>2018-12-14 05:07:21 +0100
commit769c2d2680c365cfafb35e27bc1d3b39deac118e (patch)
tree9e6453eccdc3909bdff0f14c77daf58edb65a037 /app
parent11a91592aac049c6c0efffbb9b17347663303d47 (diff)
Error message for avatar image that's too large. #9204 (#9518)
* Error message for avatar image that's too large. #9204

* Code climate/formatting

* Removed avatar error message

* Moved valid image dimentions check to update service

* removed unnescessary begin block

* code climate formatting

* code climate indent fix
Diffstat (limited to 'app')
-rw-r--r--app/services/update_account_service.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/services/update_account_service.rb b/app/services/update_account_service.rb
index 36665177d..01756a73d 100644
--- a/app/services/update_account_service.rb
+++ b/app/services/update_account_service.rb
@@ -12,6 +12,9 @@ class UpdateAccountService < BaseService
       check_links(account)
       process_hashtags(account)
     end
+  rescue Mastodon::DimensionsValidationError => de
+    account.errors.add(:avatar, de.message)
+    false
   end
 
   private