hive-forge: add # Errors docs on every verb's pub fn run (closes #816)
systemic gap argus flagged on PR #798 (timeline verb). every `pub fn run` in hive-forge/src/verbs/*.rs lacked a `# Errors` block — violates Rust API guidelines + obscures the failure surface for operators reading the source. uniform doc per verb category: - pure GET + print verbs: "transport error from the Forgejo REST call + I/O error from stdout" - body-from-file verbs (comment/comment_edit/issue_create/issue_edit/ pr_create): adds 'I/O error from --body-file/stdin input' - file-upload verbs (attach-issue, attach-comment): adds 'file read/exist check' - pr_create: also mentions the --push shellout 23 `pub fn run` signatures touched. no behaviour change; pure documentation sweep. cargo test green (38 tests).
This commit is contained in:
parent
a12c097044
commit
1195bfbe11
23 changed files with 130 additions and 0 deletions
|
|
@ -26,6 +26,12 @@ pub struct CommentArgs {
|
|||
file: PathBuf,
|
||||
}
|
||||
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the input file doesn't exist or can't be
|
||||
/// read. Propagates any transport error from the Forgejo REST call
|
||||
/// (network unreachable, 4xx/5xx response, token missing/invalid)
|
||||
/// and any I/O error from writing the browser download URL to stdout.
|
||||
pub fn run_issue(client: &Client, args: IssueArgs) -> Result<()> {
|
||||
if !args.file.is_file() {
|
||||
bail!(
|
||||
|
|
@ -42,6 +48,12 @@ pub fn run_issue(client: &Client, args: IssueArgs) -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the input file doesn't exist or can't be
|
||||
/// read. Propagates any transport error from the Forgejo REST call
|
||||
/// (network unreachable, 4xx/5xx response, token missing/invalid)
|
||||
/// and any I/O error from writing the browser download URL to stdout.
|
||||
pub fn run_comment(client: &Client, args: CommentArgs) -> Result<()> {
|
||||
if !args.file.is_file() {
|
||||
bail!(
|
||||
|
|
|
|||
Loading…
Reference in a new issue