Skip to content

Commit b538abe

Browse files
committed
more exception classes
1 parent 2ecf87d commit b538abe

File tree

6 files changed

+120
-0
lines changed

6 files changed

+120
-0
lines changed

lib/X/Comp.pod

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,25 @@
66
77
Common role for compile-time errors.
88
9+
Note that since the backtrace of a compile time error generally shows
10+
routines from the compiler, not from user-space programs, the L<Backtrace>
11+
returned from the L<backtrace> method is not very informative. Instead
12+
the exception carries its own C<filename>, C<line> and C<column> attributes
13+
and public accessors.
14+
15+
=head1 Methods
16+
17+
=head2 filename
18+
19+
The filename in which the compilation error occurred
20+
21+
=head2 line
22+
23+
The line number in which the compilation error occurred.
24+
25+
=head2 column
26+
27+
The column number of location where the compilation error occurred.
28+
(Rakudo does not implement that yet).
29+
930
=end pod

lib/X/IO/Chmod.pod

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
=begin pod
2+
3+
=TITLE class X::IO::Chmod
4+
5+
class X::IO::Chmod does X::IO is Exception
6+
7+
Error class for failed C<chmod> calls.
8+
9+
A typical error message is
10+
11+
Failed to set the mode of '/home/other' to '0o777': Permission denied
12+
13+
=end pod

lib/X/IO/Rmdir.pod

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
=begin pod
2+
3+
=TITLE class X::IO::Rmdir
4+
5+
my class X::IO::Rmdir does X::IO is Exception
6+
7+
Error class for failed L<&rmdir> operations.
8+
9+
A typical error message is
10+
11+
Failed to remove the directory 'lib': Directory not empty
12+
13+
=head1 Methods
14+
15+
=head2 path
16+
17+
Returns the path L<&rmdir> failed to remove
18+
19+
=end pod

lib/X/IO/Unlink.pod

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
=begin pod
2+
3+
=TITLE class X::IO::Unlink
4+
5+
class X::IO::Unlink does X::IO is Exception
6+
7+
Error class for failed L<&unlink> operation.
8+
9+
A typica error message is
10+
11+
Failed to remove the file 'secret': Permission defined
12+
13+
=head1 Methods
14+
15+
=head2 path
16+
17+
Returns the path that L<&unlink> failed to delete.
18+
19+
=end pod

lib/X/NYI.pod

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
=begin pod
2+
3+
=TITLE class X::NYI
4+
5+
class X::NYI is Exception { }
6+
7+
Error class for unimplemented features. I<NYI> stands for I<Not Yet
8+
Implemented>.
9+
10+
If a Perl 6 compiler is not yet feature complete, it may throw an C<X::NYI>
11+
exception when a program uses a feature that it can detect is not yet
12+
implemented.
13+
14+
A full-featured Perl 6 compiler must not throw such exceptions, but
15+
still provide the C<X::NYI> class for compatiblity reasons.
16+
17+
A typical error message is
18+
19+
HyperWhatever is not yet implemented. Sorry.
20+
21+
=head1 Methods
22+
23+
=head2 features
24+
25+
Returns a C<Str> describing the missing feature.
26+
27+
=end pod

lib/X/Placeholder/Block.pod

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
=begin pod
2+
3+
=TITLE class X::Placeholder
4+
5+
class X::Placeholder::Block does X::Comp
6+
7+
Thrown when a placeholder variable is used in a block that does not allow a
8+
signature (for example C<class A { $^foo }>.
9+
10+
11+
A typical error message is
12+
13+
Placeholder variable $^foo may not be used here because the surrounding block takes no signature
14+
15+
=head1 Methods
16+
17+
=head2 placeholder
18+
19+
Returns the name of the (first) illegally used placeholder.
20+
21+
=end pod

0 commit comments

Comments
 (0)