Fixes #71
During user creation, an exception while sending the confirmation email would hang express. Wrap the email confirmation sending in try/catch. Emit event 'confirmation-email-error' if mail fails to send.
I also noted that the promise returned by createUser() is a promise-constructor anti-pattern, exceptions thrown by prepareNewUser() and insertNewUserDocument() might also hang Express. Though I'm not sure what those exceptions might be.
Fixes #71 During user creation, an exception while sending the confirmation email would hang express. Wrap the email confirmation sending in try/catch. Emit event 'confirmation-email-error' if mail fails to send.
I also noted that the promise returned by createUser() is a promise-constructor anti-pattern, exceptions thrown by prepareNewUser() and insertNewUserDocument() might also hang Express. Though I'm not sure what those exceptions might be.