=begin pod :kind("Type") :subkind("class") :category("exception")

=TITLE class X::Str::Numeric

=SUBTITLE Error while trying to coerce a string to a number

    class X::Str::Numeric is Exception { }

Error thrown (or wrapped in a C<Failure>) when a conversion from string to
a number fails.

For example

    say +"42 answers";
    CATCH { default { put .^name, ': ', .Str } };
    # OUTPUT: «X::Str::Numeric: Cannot convert string to number: trailing characters after number in '42⏏ answers' (indicated by ⏏)␤»

=head1 Methods

=head2 method source

    method source(--> Str:D)

Returns the string that was attempted to convert to a number

=head2 method pos

    method pos(--> Int:D)

Gives the position into the string where the parsing failed.

=head2 method reason

    method reason(--> Int:D)

Verbal description of the reason why the conversion failed.

=end pod
