Skip to content

Commit 4a50cb3

Browse files
committed
feat: improve language error handling and adjust test
1 parent 06bbedf commit 4a50cb3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

e2e/commands/noError.ts

+2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ module.exports = {
66
browser.getLog('browser', (logEntries) => {
77
const errors = logEntries.filter((entry) => entry.level.name === 'SEVERE');
88
if (errors.length > 0) {
9+
console.log('\nBROWSER CONSOLE ERRORS:');
910
console.error(errors);
11+
console.log('\n');
1012
}
1113
browser.assert.equal(errors.length, 0, 'No console errors found');
1214
}),

src/app/core/language/language.service.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ export class LanguageService {
3434
if (lng && Object.values(LanguageCode).includes(lng)) {
3535
this._setFn(lng);
3636
} else {
37-
console.error('Invalid language code', lng);
37+
if (lng) {
38+
console.error('Invalid language code', lng);
39+
} else {
40+
console.warn('No language code provided');
41+
}
3842
this.setFromBrowserLngIfAutoSwitchLng();
3943
}
4044
}

0 commit comments

Comments
 (0)