Add bin and edit workflow
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s

This commit is contained in:
2026-09-16 13:11:16 -06:00
parent c8ac4fcae5
commit 4cee170d66
17576 changed files with 895740 additions and 2 deletions
@@ -0,0 +1,35 @@
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2024-2025, by Samuel Williams.
require_relative "wrapper"
require_relative "../event/failure"
module Console
module Output
# A wrapper for outputting failure messages, which can include exceptions.
class Failure < Wrapper
def initialize(output, **options)
super(output, **options)
end
# The exception must be either the last argument or passed as an option.
def call(subject = nil, *arguments, exception: nil, **options, &block)
if exception.nil?
last = arguments.last
if last.is_a?(Exception)
options[:event] = Event::Failure.for(last)
end
elsif exception.is_a?(Exception)
options[:event] = Event::Failure.for(exception)
else
# We don't know what this is, so we just pass it through:
options[:exception] = exception
end
super(subject, *arguments, **options)
end
end
end
end