fix(client): Vague Error messages (#36047)

Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
This commit is contained in:
Parth Parth
2019-06-19 15:31:03 +01:00
committed by mrugesh
parent e6a3df45f1
commit 67028025d1
4 changed files with 8 additions and 8 deletions

View File

@ -50,9 +50,9 @@ export default function(UserIdent) {
new Error('invalid or empty email recieved from auth0'), new Error('invalid or empty email recieved from auth0'),
{ {
message: dedent` message: dedent`
Oops... something is not right. We did not find a valid email from your ${provider} did not return a valid email address.
${provider} account. Please try again with a different provider that has an Please try again with a different account that has an
email available with it. email associated with it your update your settings on ${provider}, for us to be able to retrieve your email.
`, `,
type: 'info', type: 'info',
redirectTo: '/' redirectTo: '/'
@ -73,8 +73,7 @@ export default function(UserIdent) {
new Error('could not find or create a user'), new Error('could not find or create a user'),
{ {
message: dedent` message: dedent`
Oops... something is not right. We could not find or create a We could not find or create a user with that email address.
user with that email.
`, `,
type: 'info', type: 'info',
redirectTo: '/' redirectTo: '/'

View File

@ -53,7 +53,7 @@ module.exports = function enableAuthentication(app) {
if (err) { if (err) {
throw wrapHandledError(new Error('could not destroy session'), { throw wrapHandledError(new Error('could not destroy session'), {
type: 'info', type: 'info',
message: 'Oops, something is not right.', message: 'We could not log you out, please try again in a moment.',
redirectTo: homeLocation redirectTo: homeLocation
}); });
} }

View File

@ -205,7 +205,7 @@ function createPostReportUserProfile(app) {
if (!username || !report || report === '') { if (!username || !report || report === '') {
return res.json({ return res.json({
type: 'danger', type: 'danger',
message: 'Oops, something is not right please re-check your submission.' message: 'Check if you have provided a username and a report'
}); });
} }
return Email.send$( return Email.send$(

View File

@ -26,7 +26,8 @@ export default function prodErrorHandler() {
const redirectTo = handled.redirectTo || `${homeLocation}/`; const redirectTo = handled.redirectTo || `${homeLocation}/`;
const message = const message =
handled.message || 'Oops! Something went wrong. Please try again later'; handled.message ||
'Oops! Something went wrong. Please try again in a moment.';
if (isDev) { if (isDev) {
console.error(err); console.error(err);