Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

excessive errors when foo.pl does not exist #2769

Closed
p6rt opened this issue May 18, 2012 · 10 comments
Closed

excessive errors when foo.pl does not exist #2769

p6rt opened this issue May 18, 2012 · 10 comments

Comments

@p6rt
Copy link

p6rt commented May 18, 2012

Migrated from rt.perl.org#112988 (status was 'resolved')

Searchable as RT112988$

@p6rt
Copy link
Author

p6rt commented May 18, 2012

From @Siddhant

$ perl6 foo
Error while reading from file​: Unable to open filehandle from path 'foo.pl'
current instr.​: 'nqp;HLL;Compiler;_block1994' pc 35586
(src/stage2/gen/NQPHLL.pir​:13627) (src/stage2/gen/NQPHLL.pm​:1453)
called from Sub 'nqp;HLL;Compiler;evalfiles' pc 35251
(src/stage2/gen/NQPHLL.pir​:13472) (src/stage2/gen/NQPHLL.pm​:1439)
called from Sub 'nqp;HLL;Compiler;_block1868' pc 34069
(src/stage2/gen/NQPHLL.pir​:12887) (src/stage2/gen/NQPHLL.pm​:1387)
called from Sub 'nqp;HLL;Compiler;command_eval' pc 33637
(src/stage2/gen/NQPHLL.pir​:12701) (src/stage2/gen/NQPHLL.pm​:1402)
called from Sub 'nqp;Perl6;Compiler;command_eval' pc 1205
(src/gen/perl6-compiler.pir​:485) (src/Perl6/Compiler.nqp​:18)
called from Sub 'nqp;HLL;Compiler;command_line' pc 33259
(src/stage2/gen/NQPHLL.pir​:12525) (src/stage2/gen/NQPHLL.pm​:1353)
called from Sub 'MAIN' pc 1029 (src/gen/perl6.pir​:392) (src/main.nqp
src/gen/main-version.nqp​:35)
called from Sub '_block1000' pc 105 (src/gen/perl6.pir​:73)
(src/main.nqp src/gen/main-version.nqp​:1)

now, that's too much information. Ideally it should be something like
what perl(5) says :

$ perl foo.pl
Can't open perl script "foo.pl"​: No such file or directory

It clearly says "no such file".

@p6rt
Copy link
Author

p6rt commented Oct 7, 2014

From @usev6

This looks better now​:

$ perl6-m foo
Could not open foo. Failed to open file​: no such file or directory
$ perl6-p foo
Could not open foo. Unable to open filehandle from path 'foo'​: No such file or directory(2)
$ perl6-j foo
Could not open foo. java.nio.file.NoSuchFileException​: foo

So, I'd say closable with tests. (Though I don't know how a good test would look like.)

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 7, 2014

From @usev6

This looks better now​:

$ perl6-m foo
Could not open foo. Failed to open file​: no such file or directory
$ perl6-p foo
Could not open foo. Unable to open filehandle from path 'foo'​: No such file or directory(2)
$ perl6-j foo
Could not open foo. java.nio.file.NoSuchFileException​: foo

So, I'd say closable with tests. (Though I don't know how a good test would look like.)

@p6rt
Copy link
Author

p6rt commented Oct 7, 2014

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 9, 2014

From @coke

On Tue Oct 07 13​:11​:24 2014, bartolin@​gmx.de wrote​:

This looks better now​:

$ perl6-m foo
Could not open foo. Failed to open file​: no such file or directory
$ perl6-p foo
Could not open foo. Unable to open filehandle from path 'foo'​: No such
file or directory(2)
$ perl6-j foo
Could not open foo. java.nio.file.NoSuchFileException​: foo

So, I'd say closable with tests. (Though I don't know how a good test
would look like.)

use the is_run helper function from Test​::Util - you can exec out to the same perl6 that was used to run the tests with an unlikely to be found filename.pl, then check the output in STDERR. (that it contains "Could not open <file>")

--
Will "Coke" Coleda

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 9, 2014

From @coke

On Tue Oct 07 13​:11​:24 2014, bartolin@​gmx.de wrote​:

This looks better now​:

$ perl6-m foo
Could not open foo. Failed to open file​: no such file or directory
$ perl6-p foo
Could not open foo. Unable to open filehandle from path 'foo'​: No such
file or directory(2)
$ perl6-j foo
Could not open foo. java.nio.file.NoSuchFileException​: foo

So, I'd say closable with tests. (Though I don't know how a good test
would look like.)

use the is_run helper function from Test​::Util - you can exec out to the same perl6 that was used to run the tests with an unlikely to be found filename.pl, then check the output in STDERR. (that it contains "Could not open <file>")

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 10, 2014

From @usev6

I added a test (using is_run) to S19-command-line/arguments.t with the following commit​:
Raku/roast@3cee096456

S19-command-line/arguments.t is a new file in roast and as such not yet included in t/spectest.data in Rakudo. I'll leave the ticket open until that is done.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 10, 2014

From @usev6

I added a test (using is_run) to S19-command-line/arguments.t with the following commit​:
Raku/roast@3cee096456

S19-command-line/arguments.t is a new file in roast and as such not yet included in t/spectest.data in Rakudo. I'll leave the ticket open until that is done.

@p6rt
Copy link
Author

p6rt commented Oct 16, 2014

From @usev6

S19-command-line/arguments.t is now in Rakudo's t/spectest.data​: rakudo/rakudo@a6f181e7b0

@p6rt
Copy link
Author

p6rt commented Oct 16, 2014

@usev6 - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant