Skip to content

Commit

Permalink
Add given value to bad-directive-type error
Browse files Browse the repository at this point in the history
which is X::Str::Sprintf::Directives::BadType.
  • Loading branch information
MasterDuke17 committed Mar 2, 2019
1 parent 845433b commit 54a89b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/Exception.pm6
Expand Up @@ -2112,8 +2112,9 @@ my class X::Str::Sprintf::Directives::Unsupported is Exception {
my class X::Str::Sprintf::Directives::BadType is Exception {
has str $.type;
has str $.directive;
has $.value;
method message() {
"Directive $.directive not applicable for type $.type"
"Directive $.directive not applicable for value of type $.type ($.value[0])"
}
}

Expand Down
1 change: 1 addition & 0 deletions src/core/Rakudo/Internals.pm6
Expand Up @@ -1370,6 +1370,7 @@ implementation detail and has no serviceable parts inside"
X::Str::Sprintf::Directives::BadType.new:
type => nqp::atkey(nqp::atkey(payload, 'BAD_TYPE_FOR_DIRECTIVE'), 'TYPE'),
directive => nqp::atkey(nqp::atkey(payload, 'BAD_TYPE_FOR_DIRECTIVE'), 'DIRECTIVE'),
value => nqp::atkey(nqp::atkey(payload, 'BAD_TYPE_FOR_DIRECTIVE'), 'VALUE'),
}
elsif nqp::existskey(payload, 'BAD_DIRECTIVE') {
X::Str::Sprintf::Directives::Unsupported.new:
Expand Down

0 comments on commit 54a89b6

Please sign in to comment.