Skip to content

Commit

Permalink
Merge pull request #56 from Sija/develop
Browse files Browse the repository at this point in the history
v1.5.3
  • Loading branch information
Sija authored Nov 18, 2019
2 parents 3bc4900 + bdac84b commit 7761c94
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Raven supports two methods of capturing exceptions:
```crystal
Raven.capture do
# capture any exceptions which happen during execution of this block
1 / 0
1 // 0
end
begin
Expand Down
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: raven
version: 1.5.2
version: 1.5.3

authors:
- Sijawusz Pur Rahnama <sija@sija.pl>
Expand Down
15 changes: 7 additions & 8 deletions src/crash_handler.cr
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,14 @@ module Raven
end
end

private def capture_process_failure(exit_code, output, error)
private def capture_process_failure(exit_code, error)
msg = "Process #{name} exited with code #{exit_code}"
cmd = (args = @args) ? "#{name} #{args.join ' '}" : name

capture_with_options msg do |event|
event.culprit = cmd
event.extra.merge!({
output: output,
error: error,
error: error,
})
end
end
Expand All @@ -140,13 +139,13 @@ module Raven
delegate :exit_code, :success?,
to: process_status

private def run_process(output : IO = IO::Memory.new, error : IO = IO::Memory.new)
private def run_process(error : IO = IO::Memory.new)
@process_status = Process.run command: name, args: args,
shell: true,
input: STDIN,
output: IO::MultiWriter.new(STDOUT, output),
output: STDOUT,
error: IO::MultiWriter.new(STDERR, error)
{output.to_s.chomp, error.to_s.chomp}
error.to_s.chomp
end

def run : Nil
Expand All @@ -155,7 +154,7 @@ module Raven

capture_with_options do
start = Time.monotonic
output, error = run_process
error = run_process
running_for = Time.monotonic - start

context.tags.merge!({
Expand Down Expand Up @@ -188,7 +187,7 @@ module Raven
captured = true
end
unless captured
capture_process_failure(exit_code, output, error)
capture_process_failure(exit_code, error)
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/raven/version.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Raven
VERSION = "1.5.2"
VERSION = "1.5.3"
end

0 comments on commit 7761c94

Please sign in to comment.