HomePhorge

(#7269) Better error reporting for bad render formats.
632a0a0042ebUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#7269) Better error reporting for bad render formats.

Previously we would try and send nil to a class to render an unsupported
format, which was bad. Worse, we would only discover this *after* the fact,
when we tried to render, so the entire action had run and the result was lost
to the world.

Instead, validate the parameter early and fail during option parsing. This
has less nice error reporting than we can get handling it later[1], but it
gets us a much better overall set of behaviour.

[1] puppet/application.rb will print and exit, rather than raising, when the

option handler fails; this will improve when we unify face and application
options properly.

Reviewed-By: Max Martin <max@puppetlabs.com>

Details

Provenance
Daniel Pittman <daniel@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU80adaea6319b: (#7160) Support 'json' as a rendering method for CLI faces.
Branches
Unknown
Tags
Unknown

Event Timeline

Daniel Pittman <daniel@puppetlabs.com> committed rPU632a0a0042eb: (#7269) Better error reporting for bad render formats. (authored by Daniel Pittman <daniel@puppetlabs.com>).Apr 28 2011, 7:51 PM