Skip to content

Commit

Permalink
feat: improve language error handling and adjust test
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesjo committed Jan 10, 2025
1 parent 06bbedf commit 4a50cb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions e2e/commands/noError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ module.exports = {
browser.getLog('browser', (logEntries) => {
const errors = logEntries.filter((entry) => entry.level.name === 'SEVERE');
if (errors.length > 0) {
console.log('\nBROWSER CONSOLE ERRORS:');
console.error(errors);
console.log('\n');
}
browser.assert.equal(errors.length, 0, 'No console errors found');
}),
Expand Down
6 changes: 5 additions & 1 deletion src/app/core/language/language.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ export class LanguageService {
if (lng && Object.values(LanguageCode).includes(lng)) {
this._setFn(lng);
} else {
console.error('Invalid language code', lng);
if (lng) {
console.error('Invalid language code', lng);
} else {
console.warn('No language code provided');
}
this.setFromBrowserLngIfAutoSwitchLng();
}
}
Expand Down

0 comments on commit 4a50cb3

Please sign in to comment.