Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Hapi v2 rebased #537

Merged
merged 7 commits into from Feb 6, 2014
Merged

Hapi v2 rebased #537

merged 7 commits into from Feb 6, 2014

Conversation

chilts
Copy link
Contributor

@chilts chilts commented Feb 5, 2014

Fixes #495.

@dannycoates
Copy link
Contributor

@rfk can you take a look at this? I recommend excluding the last 2 commit when you diff, they're cosmetic and screw it all up.

Specifically I'd like your feedback on error.js. I feel a little dirty about masquerading as a Boom with isBoom = true but it makes things _way_ easier.

@@ -122,7 +138,8 @@ module.exports = function (path, url, Hapi, toobusy) {
if (toobusy()) {
exit = error.serviceUnavailable()
}
log.begin('server.onRequest', request);
log.begin('--- ' + request.id + ' ---', request);
log.begin('=== server.onRequest ===', request);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want multiple log.begins and no "---" or "===" funny stuff

@dannycoates dannycoates added this to the Feb 14 milestone Feb 6, 2014
@rfk
Copy link
Contributor

rfk commented Feb 6, 2014

Just to ack your request here, I'm burried under some syncserver stuff at the moment but should be able to look at this later today or tomorrow

@dannycoates
Copy link
Contributor

@rfk no worries, at your leisure 🍸

var object = Hoek.applyToDefaults(DEFAULTS, srcObject)
if (srcObject.hasOwnProperty('message')) {
object.message = srcObject.message
AppError.translate = function (payload) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is non-obvious enough to deserve a brief comment line e.g. "translate from internal hapi error objects into our standardized format"

@rfk
Copy link
Contributor

rfk commented Feb 6, 2014

This looks good to me. There's no obviously "right" solution to our error-management needs, and I think what you've done here appropriately minimises the ickyness.

It may bite us if internal details of hapi happen to change, but hey, that's why we have tests!

@dannycoates
Copy link
Contributor

Thanks @rfk, I've got a branch in progress with more changes to error.js that I'll append your suggestions to. Lets 🚢 this 🍪

dannycoates added a commit that referenced this pull request Feb 6, 2014
@dannycoates dannycoates merged commit 4b54c20 into mozilla:master Feb 6, 2014
rfk pushed a commit that referenced this pull request Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to Hapi v2 (and therefore Joi v2 too)
3 participants