Skip to content

Commit

Permalink
Invoke close_write(error) if possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Oct 29, 2024
1 parent 968ae4e commit 3d0cf2e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/xrb/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ def to_buffer(scope)
def to_proc(scope = @binding.dup)
proc do |output|
to_string(scope, output)
rescue => error
raise
ensure
if output.method(:close_write).arity == 1
output.close_write(error)
else
output.close_write
end
end
end

Expand Down

0 comments on commit 3d0cf2e

Please sign in to comment.