Skip to content

[Feature Idea] Improve Error Handling #37

@albertalef

Description

@albertalef

Problem: Need a non rescue way to handle of success/failure.

Solution: Add fluent methods to then and catch

sh(meta: true) do
  make!("build").then do |result|
    puts "[✓] make build completed in {result.meta.timestamp}s"
  end.catch do
    puts "[✗] make build failed"
  end.exec

  # Another way
  when_finish = proc { puts "Success" }
  when_fail = proc { puts "Failed" }

  make("build", _then: when_finish, _catch: when_fail)
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions