Motivation
The manage script may be used from a program -- either via HTTP or by program execution.
In that case, it's handy if an operation success/failure can be determined easily by the program.
Description and Documentation
The TWiki::OopsException with the following def values will return "400 bad request" status code.
- unrecognized_action
- missing_action
- notwikiuser
- in_a_group
- wrong_password
- web_missing
- invalid_web_name
- no_web_metadata
- base_web_missing
- web_exists
- topic_exists_new_web
- invalid_web_color
- web_creation_error
- not_wikiword
- delete_err
- move_err
- rename_topic_exists
- web_exists_topic_rename
- system_web_name
- rename_web_exists
- topic_exists_web_rename
- rename_web_prerequisites
- rename_err
- rename_web_err
- save_error
The TWiki::OopsException with following def values is already returning 4XX status code.
- post_method_only
- topic_access
In addition, when the manage script is executed from command line, if it causes 4XX status code, it will exist with 1 status code. Otherwise, it exists with 0.
This will make it trivial to determine if the manage script execution succeeded or not.
Examples
Impact
Implementation
--
Contributors:
Hideyo Imazu - 2020-06-10
Discussion
Perfect, any improvements that support automation is good!
--
Peter Thoeny - 2020-06-11