Skip to content

Commit e81adfe

Browse files
committed
Better error messages in Sentinel example.
1 parent fd69a00 commit e81adfe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/consistency.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test
8080
check_consistency(key,val.to_i)
8181
@reads += 1
8282
rescue => e
83-
puterr "Reading: #{e.to_s}"
83+
puterr "Reading: #{e.class}: #{e.message} (#{e.backtrace.first})"
8484
@failed_reads += 1
8585
end
8686

@@ -89,7 +89,7 @@ def test
8989
@cached[key] = @r.incr(key).to_i
9090
@writes += 1
9191
rescue => e
92-
puterr "Writing: #{e.to_s}"
92+
puterr "Writing: #{e.class}: #{e.message} (#{e.backtrace.first})"
9393
@failed_writes += 1
9494
end
9595

0 commit comments

Comments
 (0)