Skip to content

Commit

Permalink
Fix incorrect attribute name in X::AdHoc.new
Browse files Browse the repository at this point in the history
- Partially phixes #1266
- Includes todoed test that still wants to be told
    what the better message is
  • Loading branch information
zoffixznet committed Nov 24, 2017
1 parent eacf9b2 commit 3166400
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/IO/Socket/Async.pm
Expand Up @@ -198,7 +198,7 @@ my class IO::Socket::Async {
# do nothing
}
elsif err {
quit(X::AdHoc.new(message => err));
quit(X::AdHoc.new(payload => err));
$finished = 1;
}
else {
Expand Down
10 changes: 9 additions & 1 deletion t/05-messages/02-errors.t
Expand Up @@ -2,7 +2,7 @@ use lib <t/packages/>;
use Test;
use Test::Helpers;

plan 2;
plan 3;

# RT #132295

Expand All @@ -16,4 +16,12 @@ throws-like { for [:a] X [:b] -> ($i, $j) { } },
message => / '<anon>' /,
"anonymous subs get '<anon>' in arity error messages";

todo 'needs better error message';
throws-like {
sub l { IO::Socket::Async.listen: "localhost", 111390 }
react whenever l() {
whenever l() {} # try to listen on already open sock
}
}, X::AdHoc, message => /'something good'/

# vim: ft=perl6 expandtab sw=4

0 comments on commit 3166400

Please sign in to comment.