]> cat aescling's git repositories - mastodon.git/commit
Improve error handling in PostStatusService
authoraescling <aescling+gitlab@cat.family>
Tue, 6 Jun 2023 16:46:09 +0000 (12:46 -0400)
committeraescling <aescling+gitlab@cat.family>
Tue, 4 Jul 2023 20:26:13 +0000 (16:26 -0400)
commit33c45e90f6750f7a34ccf1c994fdf8b46e881e4e
treecb0f91beac6ac3863e032e7633719f1a41c42d6e
parent4ca6883abb447b6e6258cac44e12c54cbeeae77c
Improve error handling in PostStatusService

* Explicitly catch invalid post visibility, and 422 instead of 500
        - ~~Reject "limited" visibility~~
        - Accept empty visibilities, ignoring them
* Explicitly alert the user when a post is rejected for having both
  media and polls

The former currently allows the visibility property to be blank or null.
I do not know if this is more desirable than, for example, rejecting
empty strings.

Additionally to the above, improve documentation for the call method.

* Improve consistency in documentation
* Improve rubocop assessment in new code we are responsible for
        - Improve documentation

* Correct scheduled post parse error semantics
        - Return 422, not 400
        - Respond with a useful error message

* Allow creating limited visibility posts from the API again

* Add appropriate yard tags to documentation

* Correct erronous documentation, copy-editing it somewhat
- Use a labelled list for Status#visibility
- Improve specificity of "make a note of that"

* Remove PostStatusService#visibility_invalid?
- !visibility_invalid? -> !visibility_valid?
app/models/status.rb
app/services/post_status_service.rb
config/locales-kibicat/en.yml