Skip to content

Report errors when loading helpers#79

Merged
jagoda merged 1 commit intohapijs:masterfrom
jagoda:feat-helper-errors
Apr 4, 2016
Merged

Report errors when loading helpers#79
jagoda merged 1 commit intohapijs:masterfrom
jagoda:feat-helper-errors

Conversation

@jagoda
Copy link
Copy Markdown
Contributor

@jagoda jagoda commented Mar 31, 2016

Fixes #73.

@jagoda jagoda added the feature New functionality or improvement label Mar 31, 2016
@jagoda jagoda added this to the 4.1.0 milestone Mar 31, 2016
@jagoda
Copy link
Copy Markdown
Contributor Author

jagoda commented Apr 1, 2016

@mtharrison @mugli this look like it meets your needs?

@mtharrison
Copy link
Copy Markdown

Having second thoughts about this, feels a bit wrong to me for a library to log to my stdout, even in warning situation. It could mess up whatever logging strategy I have in place. I wonder if there's a better way of doing this without throwing. Would it possible to use the hapi request.log()/server.log() here? Or at least use console.error() or console.warn() so it's sent to stderr.

Anyone else have a good idea?

@devinivy
Copy link
Copy Markdown
Member

devinivy commented Apr 1, 2016

I personally think sending it to stderr is sufficient, and I agree that sending it to stdout feels bad. I'm not totally convinced that hapi logging applies here very well. Hrm!

@jagoda
Copy link
Copy Markdown
Contributor Author

jagoda commented Apr 2, 2016

Thanks for the feedback! @mtharrison I considered server.log() but it seemed to run up against some of your earlier concerns that the warning may not be immediately apparent in the default case. This is because logging would have to be explicitly configured on the server (either via a plugin or the debug option) in order to see the output. Also, since this issue seems to skew toward the development cycle I don't think that a whole lot is lost by not sending the warning to server.log(). However, I had not considered how stdout could mess up other logging strategies. console.warn() seems reasonable to me. I will update accordingly if nobody can think of any final objections.

@jagoda jagoda force-pushed the feat-helper-errors branch from 81091f5 to fa2e90a Compare April 2, 2016 13:37
@jagoda jagoda merged commit ff9be92 into hapijs:master Apr 4, 2016
@jagoda jagoda deleted the feat-helper-errors branch April 4, 2016 20:23
@lock
Copy link
Copy Markdown

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature New functionality or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send helper parsing error to user

3 participants