Skip to content
  • Stan Lo's avatar
    12b7c129
    [ruby/irb] Gracefully handle missing command argument · 12b7c129
    Stan Lo authored
    (https://github.com/ruby/irb/pull/473)
    
    * Handle file loading commands' argument error gracefully
    
    Currently, if users don't provide an argument to `source`,
    `irb_load`, and `irb_require`, IRB raises `ArgumentError` with full
    stacktrace. This is confusing because it looks similar to when IRB has
    internal issues. The message also isn't helpful on helping users avoid
    the error.
    
    So in this commit, I add a new `CommandArgumentError` for commands to
    raise explicitly when users' input doesn't satisfy a command's argument
    requirement.
    
    * Gracefully handle `fg` command's argument requirement
    12b7c129
    [ruby/irb] Gracefully handle missing command argument
    Stan Lo authored
    (https://github.com/ruby/irb/pull/473)
    
    * Handle file loading commands' argument error gracefully
    
    Currently, if users don't provide an argument to `source`,
    `irb_load`, and `irb_require`, IRB raises `ArgumentError` with full
    stacktrace. This is confusing because it looks similar to when IRB has
    internal issues. The message also isn't helpful on helping users avoid
    the error.
    
    So in this commit, I add a new `CommandArgumentError` for commands to
    raise explicitly when users' input doesn't satisfy a command's argument
    requirement.
    
    * Gracefully handle `fg` command's argument requirement
Loading