Skip to content

Commit 0de77a4

Browse files
Merge pull request #4209 from fossasia/development
2 parents b85fa50 + 99b652a commit 0de77a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1537
-1353
lines changed

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports = {
6262
],
6363
'max-len': 'off',
6464
'no-console': ["error", { allow: ["warn", "error"] }],
65-
'prefer-template': 'error',
65+
'prefer-template': 'off',
6666
'camelcase': 'off',
6767
'new-cap': 'off',
6868
'eqeqeq': ['error', 'smart'],

app/components/account/danger-zone.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ export default Component.extend({
3737
id: 'account_Delete'
3838
});
3939
})
40-
.catch(() => {
40+
.catch(e => {
41+
console.error('Error while deleting account', e);
4142
this.notify.error(this.l10n.t('An unexpected error has occurred.'), {
4243
id: 'account_del_error'
4344
});

app/components/account/email-preferences-section.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export default Component.extend({
99
id: 'email_notif'
1010
});
1111
})
12-
.catch(() => {
12+
.catch(e => {
13+
console.error('Error while updating email notifications.', e);
1314
emailPreference.rollbackAttributes();
1415
this.notify.error(this.l10n.t('An unexpected error occurred.'), {
1516
id: 'email_error'

app/components/events/view/export/api-response.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export default Component.extend({
3838
json = JSON.stringify(json, null, 2);
3939
this.set('json', htmlSafe(syntaxHighlight(json)));
4040
})
41-
.catch(() => {
41+
.catch(e => {
42+
console.error('Error while fetching export JSON from server', e);
4243
this.notify.error(this.l10n.t('Could not fetch from the server'), {
4344
id: 'server_fetch_error'
4445
});

app/components/events/view/export/download-common.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ export default Component.extend({
3939
id: 'task_progress'
4040
});
4141
} else {
42+
console.error('Event exporting task failed', exportJobStatus);
4243
this.set('eventExportStatus', exportJobStatus.state);
4344
this.notify.error(this.l10n.t('Task failed.'), {
4445
id: 'task_fail'
4546
});
4647
}
4748
})
48-
.catch(() => {
49+
.catch(e => {
50+
console.error('Error while exporting event', e);
4951
this.set('eventExportStatus', 'FAILURE');
5052
this.notify.error(this.l10n.t('Task failed.'), {
5153
id: 'task_failure'
@@ -64,7 +66,8 @@ export default Component.extend({
6466
.then(exportJobInfo => {
6567
this.requestLoop(exportJobInfo);
6668
})
67-
.catch(() => {
69+
.catch(e => {
70+
console.error('Error while starting exporting job', e);
6871
this.set('isLoading', false);
6972
this.notify.error(this.l10n.t('Unexpected error occurred.'), {
7073
id: 'unexpected_down_error'

app/components/events/view/export/download-zip.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default class extends Component {
1616
id: 'export_succ'
1717
});
1818
} catch (e) {
19-
console.error(e);
19+
console.error('Error while downloading event zip', e);
2020
this.notify.error(this.l10n.t(e), {
2121
id: 'err_down'
2222
});

app/components/events/view/overview/manage-roles.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export default Component.extend({
3232
id: 'man_role'
3333
});
3434
})
35-
.catch(() => {
35+
.catch(e => {
36+
console.error('Error while updating role invite', e);
3637
this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), {
3738
id: 'man_role_err'
3839
});
@@ -50,7 +51,8 @@ export default Component.extend({
5051
});
5152
this.get('data.roleInvites').removeObject(invite);
5253
})
53-
.catch(() => {
54+
.catch(e => {
55+
console.error('Error while deleting role invite', e);
5456
this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), {
5557
id: 'err_man_role'
5658
});

app/components/forms/admin/settings/system/mail-settings/test-email-form.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default Component.extend(FormMixin, {
4040
});
4141
})
4242
.catch(e => {
43-
console.warn(e);
43+
console.error('Error while sending test email', e);
4444
this.notify.error(this.l10n.t('An unexpected error has occurred'), {
4545
id: 'test_mail_err'
4646
});

app/components/forms/admin/settings/ticket-fees-form.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export default Component.extend({
4040
id: 'fee_delete_succ'
4141
});
4242
})
43-
.catch(() => {
43+
.catch(e => {
44+
console.error('Error while deleting ticket', e);
4445
this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), {
4546
id: 'fee_err'
4647
});

app/components/forms/login-form.js

+3
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ export default class extends Component.extend(FormMixin) {
6161
}
6262
} catch (e) {
6363
if (e.json && e.json.error) {
64+
console.warn('Error while authentication', e);
6465
this.set('errorMessage', this.l10n.tVar(e.json.error));
6566
} else {
67+
console.error('Error while authentication', e);
6668
this.set('errorMessage', this.l10n.t('An unexpected error occurred.'));
6769
}
6870
}
@@ -89,6 +91,7 @@ export default class extends Component.extend(FormMixin) {
8991
id: 'error_server_msg'
9092
});
9193
} else {
94+
console.error('Error while facebook authentication', e);
9295
this.notify.error(this.l10n.t('An unexpected error has occurred'), {
9396
id: 'unexpect_error'
9497
});

app/components/forms/reset-password-form.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ export default Component.extend(FormMixin, {
6060
});
6161
this.router.transitionTo('login');
6262
})
63-
.catch(() => {
63+
.catch(e => {
64+
console.error('Error while resetting password', e);
6465
this.set('errorMessage', this.l10n.t('An unexpected error occurred.'), {
6566
id: 'reset_unexpect'
6667
});
@@ -86,8 +87,10 @@ export default Component.extend(FormMixin, {
8687
})
8788
.catch(reason => {
8889
if (reason && Object.prototype.hasOwnProperty.call(reason, 'errors') && reason.errors[0].status === 404) {
90+
console.warn('Reset Password: No user account found', reason);
8991
this.set('errorMessage', this.l10n.t('No account is registered with this email address.'));
9092
} else {
93+
console.error('Error while submitting reset password', reason);
9194
this.set('errorMessage', this.l10n.t('An unexpected error occurred.'));
9295
}
9396
})

app/components/forms/user-payment-info-form.js

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export default class extends Component.extend(FormMixin) {
106106
id: 'bill_det_updated'
107107
});
108108
} catch (error) {
109+
console.error('Error while updating billing details', error);
109110
this.authManager.currentUser.rollbackAttributes();
110111
this.notify.error(this.l10n.t('An unexpected error occurred'), {
111112
id: 'bill_det_unexpect'

app/components/forms/user-profile-form.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ export default Component.extend(FormMixin, {
6767
id: 'profi_update'
6868
});
6969
})
70-
.catch(() => {
70+
.catch(e => {
71+
console.error('Error while updating profile.', e);
7172
this.get('authManager.currentUser').rollbackAttributes();
7273
this.notify.error(this.l10n.t('An unexpected error occurred'), {
7374
id: 'profi_error'

app/components/forms/wizard/basic-details-step.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ export default Component.extend(FormMixin, EventWizardMixin, {
9696
later(this, () => {
9797
try {
9898
this.set('subTopic', null);
99-
} catch (ignored) { /* To suppress error thrown in-case this gets executed after component gets destroy */ }
99+
} catch (ignored) {
100+
/* To suppress error thrown in-case this gets executed after component gets destroy */
101+
console.warn('Error setting subTopic to null', ignored);
102+
}
100103
}, 50);
101104
if (!this.get('data.event.topic')) {
102105
return [];
@@ -403,6 +406,7 @@ export default Component.extend(FormMixin, EventWizardMixin, {
403406
}));
404407
})
405408
.catch(error => {
409+
console.error('Error while setting stripe authorization in event', error);
406410
this.notify.error(this.l10n.t(`${error.message}. Please try again`), {
407411
id: 'basic_detail_err'
408412
});

app/components/modals/change-image-modal.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export default ModalBase.extend({
1212
id: 'placeholder_sav'
1313
});
1414
})
15-
.catch(() => {
15+
.catch(e => {
16+
console.error('Error while saving placeholder.', e);
1617
this.notify.error(this.l10n.t('An unexpected error has occurred. Placeholder not saved.'), {
1718
id: 'placeholder_err'
1819
});

app/components/modals/modal-base.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ export default UiModal.extend({
3636
this._super(...arguments);
3737
try {
3838
$(this.element).modal('refresh');
39-
} catch (ignored) { /* ignored exception */ }
39+
} catch (ignored) {
40+
/* ignored exception */
41+
console.warn('Error refreshing modal', ignored);
42+
}
4043
},
4144

4245

app/components/notification-dropdown.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export default Component.extend({
2424
id: 'not_read_succ'
2525
});
2626
})
27-
.catch(() => {
27+
.catch(e => {
28+
console.error('Error while marking notifications as read.', e);
2829
this.notify.error(this.l10n.t('An unexpected error occurred.'), {
2930
id: 'not_read_error'
3031
});

app/components/public/ticket-list.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export default Component.extend(FormMixin, {
119119
this.set('invalidPromotionalCode', false);
120120
});
121121
} catch (e) {
122+
console.error('Error while applying access code', e);
122123
this.set('invalidPromotionalCode', true);
123124
}
124125
try {
@@ -148,7 +149,7 @@ export default Component.extend(FormMixin, {
148149
this.set('invalidPromotionalCode', true);
149150
}
150151
} catch (e) {
151-
console.warn(e);
152+
console.error('Error while applying discount code as promo code', e);
152153
if (this.invalidPromotionalCode) {
153154
this.set('invalidPromotionalCode', true);
154155
}

app/components/ui-table-server.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ export default ModelsTable.extend({
162162
}
163163
store.query(modelName, query)
164164
.then(newData => setProperties(this, { isLoading: false, isError: false, filteredContent: newData }))
165-
.catch(() => {
165+
.catch(e => {
166+
console.error('Error while querying data in UI Table', e);
166167
if (!this.isDestroyed) {
167168
setProperties(this, { isLoading: false, isError: true });
168169
}

app/components/unverified-user-message.js

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export default Component.extend({
2828
this.set('isMailSent', true);
2929
})
3030
.catch(error => {
31+
console.error('Error while sending verification email', error, error.error);
3132
if (error.error) {
3233
this.notify.error(this.l10n.t(error.error), {
3334
id: 'ver_mail_serv_error'

app/components/widgets/forms/file-upload.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export default Component.extend({
2828
id: 'file_upload_succ'
2929
});
3030
})
31-
.catch(() => {
31+
.catch(e => {
32+
console.error('Error while upload file', e);
3233
this.notify.error(this.l10n.t('Oops something went wrong. Please try again'), {
3334
id: 'file_upload_err'
3435
});
@@ -47,6 +48,7 @@ export default Component.extend({
4748
};
4849
reader.readAsDataURL(files[0]);
4950
}).catch(error => {
51+
console.error('Error while reading file', error);
5052
this.notify.error(error, {
5153
id: 'file_upload_err_1'
5254
});

app/components/widgets/forms/image-upload.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export default Component.extend({
3434
this.set('uploadingImage', false);
3535
this.set('imageUrl', image.url);
3636
})
37-
.catch(() => {
37+
.catch(e => {
38+
console.error('Error while uploading and setting image URL', e);
3839
this.set('uploadingImage', false);
3940
this.set('errorMessage', this.i18n.t('An unexpected error occurred.'));
4041
});
@@ -56,6 +57,7 @@ export default Component.extend({
5657
reader.readAsDataURL(files[0]);
5758

5859
}).catch(error => {
60+
console.error('Error while image reading and cropping', error);
5961
this.notify.error(error, {
6062
id: 'unexpected_image_upload_1'
6163
});

app/controllers/account/password.js

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default class extends Controller {
2121
});
2222
})
2323
.catch(error => {
24+
console.error('Error while updating password', error);
2425
if (error.errors) {
2526
this.notify.error(this.l10n.t(`${error.errors[0].detail}`),
2627
{

app/controllers/account/profile.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export default class extends Controller {
1111
{
1212
id: 'cont_info_upd'
1313
});
14-
} catch (error) {
14+
} catch (error) {
15+
console.error('Error while updating contact info', error);
1516
this.notify.error(this.l10n.t(error.message),
1617
{
1718
id: 'cont_upd_error'

app/controllers/admin/content/events.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default class extends Controller {
1515
this.set('disableEventSubtopic', false);
1616
this.set('currentTopicSelected', topic);
1717
} catch (e) {
18+
console.error('Error while updating subtopics', e);
1819
this.notify.error(this.l10n.t('An unexpected error has occurred. SubTopics not loaded.'),
1920
{
2021
id: 'subtop_error'
@@ -45,7 +46,8 @@ export default class extends Controller {
4546
id: 'event_prop_del'
4647
});
4748
})
48-
.catch(() => {
49+
.catch(e => {
50+
console.error('Error while deleting ' + modelName, e);
4951
this.notify.error(this.l10n.t('An unexpected error has occurred. Event Type was not deleted.'),
5052
{
5153
id: 'event_type_error'
@@ -68,7 +70,8 @@ export default class extends Controller {
6870
id: 'mode_add_succ'
6971
});
7072
})
71-
.catch(() => {
73+
.catch(e => {
74+
console.error('Error while adding ' + camelCasedValue, e);
7275
this.notify.error(this.l10n.t(`An unexpected error has occurred. ${startCase(camelCasedValue)} not saved.`),
7376
{
7477
id: 'mode_err_succ'

app/controllers/admin/content/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export default class extends Controller {
1313
id: 'social_link_upd'
1414
});
1515
})
16-
.catch(() => {
16+
.catch(e => {
17+
console.error('Error updating social links', e);
1718
this.notify.error(this.l10n.t('An unexpected error has occurred. Social links not saved.'),
1819
{
1920
id: 'unex_social_error'

app/controllers/admin/content/pages.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export default class extends Controller {
3232
id: 'page_detail_succ'
3333
});
3434
})
35-
.catch(() => {
35+
.catch(e => {
36+
console.error('Error saving page details', e);
3637
this.notify.error(this.l10n.t('An unexpected error has occurred. Page Details not saved.'),
3738
{
3839
id: 'page_detail_del'

app/controllers/admin/content/translations.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default class extends Controller {
1919
id: 'zip_generated_succ'
2020
});
2121
} catch (e) {
22-
console.warn(e);
22+
console.error('Error downloading translation zip', e);
2323
this.notify.error(this.l10n.t('Unexpected error occurred.'),
2424
{
2525
id: 'zip_error'

0 commit comments

Comments
 (0)