Skip to content

Commit

Permalink
fixed Mojo::Exception synopsis example
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 16, 2012
1 parent f98710b commit a8f6368
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,7 +1,8 @@

3.42 2012-09-15
3.42 2012-09-16
- Improved Hypnotoad to clean up old PID files.
- Improved documentation.
- Imptoved tests.

3.41 2012-09-13
- Improved Mojo::EventEmitter to warn about failed error events.
Expand Down
9 changes: 4 additions & 5 deletions lib/Mojo/Exception.pm
Expand Up @@ -150,8 +150,7 @@ Mojo::Exception - Exceptions with context
use Mojo::Exception;
my $e = Mojo::Exception->new('Not again!');
$e->throw;
Mojo::Exception->throw('Not again!');
=head1 DESCRIPTION
Expand All @@ -171,21 +170,21 @@ Stacktrace.
=head2 C<line>
my $line = $e->line;
$e = $e->line([3, 'foo']);
$e = $e->line([3 => 'foo']);
The line where the exception occured.
=head2 C<lines_after>
my $lines = $e->lines_after;
$e = $e->lines_after([[1, 'bar'], [2, 'baz']]);
$e = $e->lines_after([[1 => 'bar'], [2 => 'baz']]);
Lines after the line where the exception occured.
=head2 C<lines_before>
my $lines = $e->lines_before;
$e = $e->lines_before([[4, 'bar'], [5, 'baz']]);
$e = $e->lines_before([[4 => 'bar'], [5 => 'baz']]);
Lines before the line where the exception occured.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Transaction/HTTP.pm
Expand Up @@ -75,12 +75,12 @@ sub server_leftovers {
sub server_read {
my ($self, $chunk) = @_;

# Parse
# Parse request
my $req = $self->req;
$req->parse($chunk) unless $req->error;
$self->{state} ||= 'read';

# EOF
# Generate response
if ($req->is_finished && !$self->{handled}++) {
$self->emit(
upgrade => Mojo::Transaction::WebSocket->new(handshake => $self))
Expand Down

0 comments on commit a8f6368

Please sign in to comment.