Skip to content

Commit f985981

Browse files
committed
document some IO errors
1 parent 1f58d8d commit f985981

File tree

5 files changed

+96
-0
lines changed

5 files changed

+96
-0
lines changed

lib/X/IO.pod

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
=begin pod
2+
3+
=TITLE role X::IO
4+
5+
role X::IO does X::OS {}
6+
7+
Common role for IO related errors.
8+
9+
This role does not provide any additional methods.
10+
11+
=end pod

lib/X/IO/Copy.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::IO::Copy
4+
5+
class X::IO::Copy does X::IO is Exception { }
6+
7+
Error class for failed file copy operations. A typical error message is
8+
9+
Failed to copy 'source' to 'destination': permission denied
10+
11+
=head1 Methods
12+
13+
=head2 from
14+
15+
Returns the source of the failed copy operation
16+
17+
=head2 to
18+
19+
Returns the destination of the failed copy operation
20+
21+
=end pod

lib/X/IO/Mkdir.pod

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
=begin pod
2+
3+
=TITLE class X::IO::Mkdir
4+
5+
class X::IO::Mkdir does X::IO is Exception
6+
7+
Error class for failed L<mkdir> operations.
8+
9+
A typical error message is
10+
11+
Failed to create directory 'destination' with mode '0o755': File exists
12+
13+
=head1 Methods
14+
15+
=head2 path
16+
17+
Returns the path that the L<mkdir> operation failed to create.
18+
19+
=head2 mode
20+
21+
Returns the permissions mask of the failed L<mkdir> operation as an L<Int>.
22+
23+
=end pod

lib/X/IO/Rename.pod

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
=begin pod
2+
3+
=TITLE class X::IO::Rename
4+
5+
class X::IO::Rename does X::IO is Exception { }
6+
7+
Error class for failed file or directory rename operations. A typical
8+
error message is
9+
10+
Failed to rename 'source' to 'destination': is a directory
11+
12+
=head1 Methods
13+
14+
=head2 from
15+
16+
Returns the source of the failed rename operation
17+
18+
=head2 to
19+
20+
Returns the destination of the failed rename operation
21+
22+
=end pod

lib/X/OS.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 role X::OS
4+
5+
role X::OS { has $.os-error }
6+
7+
Common role for all errors that are triggered by some error
8+
reported by the operating system (failed IO, system calls,
9+
fork, memory allocation).
10+
11+
=head1 Methods
12+
13+
=head2 os-error
14+
15+
method os-error() returns Str:D
16+
17+
Returns the error as reported by the operating system.
18+
19+
=end pod

0 commit comments

Comments
 (0)