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

Error Handler for config.ini errors suppresses root cause [rt.cpan.org #80113] #692

Open
rjbs opened this issue Jul 3, 2021 · 0 comments

Comments

@rjbs
Copy link
Owner

rjbs commented Jul 3, 2021

https://rt.cpan.org/Ticket/Display.html?id=80113

The error handler for config.ini (  https://metacpan.org/source/RJBS/
Dist-Zilla-4.300025/lib/Dist/Zilla/App.pm#L61 )  is perhaps useful in some
cases, but its design suppresses  the causing error, leaving you with no
realistic idea of what is actually wrong.


If your configuration seems impervious to the flaws discussed in this message,
then you're just left confused as to what happened.

Additionally, the time at which the config loads is far too early for any -v
verbosity parameter to take effect, so there's literally nothing a user can do
with the defined Dzil interface to get more feedback on the problem.

The best you can do:  'perl -MCarp::Always -S dzil' instead of 'dzil'  ( This
syntax chosen because its hard to set ENV variables on the command line in
Win32 )

Then At least you get the obscured cause in the stacktrace ( mostly by dumb
luck ):

> dzil new -P Author::KENTNL  My::Modname -v

Your global configuration file couldn't be loaded.  It's a file matching
~/.dzil/config.*

You can try deleting the file or you might need to upgrade from pre-version 4
format.  In most cases, this will just mean replacing [!release] with [%PAUSE]
and deleting any [!new] stanza.  You can also delete the existing file and run
"dzil setup"

> perl -MCarp::Always -S dzil new -P Author::KENTNL My::Modname -v

Your global configuration file couldn't be loaded.  It's a file matching
~/.dzil/config.*

You can try deleting the file or you might need to upgrade from pre-version 4
format.  In most cases, this will just mean replacing [!release] with [%PAUSE]
and deleting any [!new] stanza.  You can also delete the existing file and run
"dzil setup"
 at C:/strawberry/perl/site/lib/Dist/Zilla/App.pm line 62.
>> Dist::Zilla::App::__ANON__('Attribute (password) is required at
constructor Dist::Zilla::...') called at C:/strawberry/perl/vendor/lib/Try/
Tiny.pm line 100
>> Try::Tiny::try('CODE(0x46368e0)', 'Try::Tiny::Catch=REF(0x47c7fb8)')
called at C:/strawberry/perl/site/lib/Dist/Zilla/App.pm line 72
>> Dist::Zilla::App::_build_global_stashes('Dist::Zilla::App=HASH
(0x3285788)') called at C:/strawberry/perl/site/lib/Dist/Zilla/App/Command/
new.pm line 49
>> Dist::Zilla::App::Command::new::execute
('Dist::Zilla::App::Command::new=HASH(0x406a370)',
'Getopt::Long::Descriptive::Opts::__OPT__::2=HASH(0x4091bf8)', 'ARRAY
(0x24f4970)') called at C:/strawberry/perl/site/lib/App/Cmd.pm line 243
>> App::Cmd::execute_command('Dist::Zilla::App=HASH(0x3285788)',
'Dist::Zilla::App::Command::new=HASH(0x406a370)',
'Getopt::Long::Descriptive::Opts::__OPT__::2=HASH(0x4091bf8)', 'My::Modname')
called at C:/strawberry/perl/site/lib/App/Cmd.pm line 171
>> App::Cmd::run('Dist::Zilla::App') called at C:\strawberry\perl\site\
bin/dzil line 12

config.ini I had was :

[%Rights]
license_class = Perl_5
copyright_holder = Kent Fredric <[email protected]>

[%PAUSE]
user = KENTNL

 

and it wasn't obvious that my deletion of the password =     stanza was
unsupported by [%PAUSE]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant