Skip to content

Commit

Permalink
More on Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
BurdetteLamar committed Jul 25, 2018
1 parent bf4dd23 commit 7945c07
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 24 deletions.
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -837,13 +837,26 @@ This example shows a simple ```Exception```.
```ruby
require 'debug_helper'
exception = nil
begin
raise Exception.new('Boo!')
rescue Exception => exception
# Already saved.
def foo
exception = nil
begin
raise Exception.new('Boo!')
rescue Exception => exception
# Already saved.
end
DebugHelper.show(exception, 'My simple exception')
end
DebugHelper.show(exception, 'My simple exception')
def bar
foo
end
def baz
bar
end
baz
```

The output shows details of the ```Exception```.
Expand All @@ -855,7 +868,10 @@ Exception (message='My simple exception'):
message: Boo!
cause:
backtrace:
- show.rb:5:in `<main>'
- show.rb:6:in `foo'
- show.rb:14:in `bar'
- show.rb:18:in `baz'
- show.rb:21:in `<main>'
```
### Range
Expand Down Expand Up @@ -1276,7 +1292,7 @@ The output shows details of the datetime.

```show.yaml```:
```yaml
--- 'DateTime (message=''My datetime'') #<DateTime: 2018-07-25T17:58:51-05:00 ((2458325j,82731s,767378000n),-18000s,2299161j)>'
--- 'DateTime (message=''My datetime'') #<DateTime: 2018-07-25T18:07:41-05:00 ((2458325j,83261s,119718000n),-18000s,2299161j)>'
```

#### Regexp
Expand Down
30 changes: 23 additions & 7 deletions markdown/readme/classes/exception/simple/show.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,26 @@ This example shows a simple ```Exception```.
```ruby
require 'debug_helper'

exception = nil
begin
raise Exception.new('Boo!')
rescue Exception => exception
# Already saved.
def foo
exception = nil
begin
raise Exception.new('Boo!')
rescue Exception => exception
# Already saved.
end
DebugHelper.show(exception, 'My simple exception')
end
DebugHelper.show(exception, 'My simple exception')

def bar
foo
end

def baz
bar
end

baz

```

The output shows details of the ```Exception```.
Expand All @@ -24,5 +37,8 @@ Exception (message='My simple exception'):
message: Boo!
cause:
backtrace:
- show.rb:5:in `<main>'
- show.rb:6:in `foo'
- show.rb:14:in `bar'
- show.rb:18:in `baz'
- show.rb:21:in `<main>'
```
25 changes: 19 additions & 6 deletions markdown/readme/classes/exception/simple/show.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
require 'debug_helper'

exception = nil
begin
raise Exception.new('Boo!')
rescue Exception => exception
# Already saved.
def foo
exception = nil
begin
raise Exception.new('Boo!')
rescue Exception => exception
# Already saved.
end
DebugHelper.show(exception, 'My simple exception')
end
DebugHelper.show(exception, 'My simple exception')

def bar
foo
end

def baz
bar
end

baz

5 changes: 4 additions & 1 deletion markdown/readme/classes/exception/simple/show.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ Exception (message='My simple exception'):
message: Boo!
cause:
backtrace:
- show.rb:5:in `<main>'
- show.rb:6:in `foo'
- show.rb:14:in `bar'
- show.rb:18:in `baz'
- show.rb:21:in `<main>'
2 changes: 1 addition & 1 deletion markdown/readme/classes/object/datetime/show.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ The output shows details of the datetime.

```show.yaml```:
```yaml
--- 'DateTime (message=''My datetime'') #<DateTime: 2018-07-25T17:58:51-05:00 ((2458325j,82731s,767378000n),-18000s,2299161j)>'
--- 'DateTime (message=''My datetime'') #<DateTime: 2018-07-25T18:07:41-05:00 ((2458325j,83261s,119718000n),-18000s,2299161j)>'
```
2 changes: 1 addition & 1 deletion markdown/readme/classes/object/datetime/show.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--- 'DateTime (message=''My datetime'') #<DateTime: 2018-07-25T17:58:51-05:00 ((2458325j,82731s,767378000n),-18000s,2299161j)>'
--- 'DateTime (message=''My datetime'') #<DateTime: 2018-07-25T18:07:41-05:00 ((2458325j,83261s,119718000n),-18000s,2299161j)>'

0 comments on commit 7945c07

Please sign in to comment.