diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2023-06-27 18:49:43 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2023-06-27 18:49:43 +0000 |
commit | ae0ca49451c8344e92221afe9378375bc3262d80 (patch) | |
tree | cd67453d8d4072ab8a16c9fc9e0a622b985fd347 /lib | |
parent | 41f2ee69a84178b83eb045145de72728208d399b (diff) | |
parent | 2c66f584b53efe834e359b6829f5a73ad067dce2 (diff) | |
download | pleroma-ae0ca49451c8344e92221afe9378375bc3262d80.tar.gz pleroma-ae0ca49451c8344e92221afe9378375bc3262d80.zip |
Merge branch 'tusooa/3119-bio-update' into 'develop'
Show more informative errors when profile exceeds char limits
Closes #3119
See merge request pleroma/pleroma!3886
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/mastodon_api/controllers/account_controller.ex | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex index c313a0e97..9a4b56301 100644 --- a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex @@ -263,6 +263,18 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do {:error, %Ecto.Changeset{errors: [background: {"file is too large", _}]}} -> render_error(conn, :request_entity_too_large, "File is too large") + {:error, %Ecto.Changeset{errors: [{:bio, {_, _}} | _]}} -> + render_error(conn, :request_entity_too_large, "Bio is too long") + + {:error, %Ecto.Changeset{errors: [{:name, {_, _}} | _]}} -> + render_error(conn, :request_entity_too_large, "Name is too long") + + {:error, %Ecto.Changeset{errors: [{:fields, {"invalid", _}} | _]}} -> + render_error(conn, :request_entity_too_large, "One or more field entries are too long") + + {:error, %Ecto.Changeset{errors: [{:fields, {_, _}} | _]}} -> + render_error(conn, :request_entity_too_large, "Too many field entries") + _e -> render_error(conn, :forbidden, "Invalid request") end |