rust-lang / triagebot

Automation/tooling for Rust spaces
https://triage.rust-lang.org
Apache License 2.0
172 stars 73 forks source link

Allow returning HandlerError::Message from command handlers #1611

Open jyn514 opened 2 years ago

jyn514 commented 2 years ago

Right now, errors in handlers are unconditionally treated as an internal error: https://github.com/rust-lang/triagebot/blob/f8f6d205b73fd6ae18c7ecbb3b1879f90b615839/src/handlers.rs#L124 But this is not always the case; for example, telling triagebot to add an invalid label is a user error and should result in leaving a comment. Right now the only way to do so is to handle the error within handle_input and return Ok(). It would be nice to keep the logic in one place by allowing handlers to return HandlerError instead.