Safer handling of broken URLs (#4573)
This commit is contained in:
parent
9d8b03de0c
commit
584648356d
|
|
@ -95,7 +95,7 @@ export default class BrowsertimePlugin extends SitespeedioPlugin {
|
|||
async processMessage(message) {
|
||||
const options = this.options;
|
||||
switch (message.type) {
|
||||
// When sistespeed.io starts, a setup messages is posted on the queue
|
||||
// When sitespeed.io starts, a setup messages is posted on the queue
|
||||
// and all plugins can tell other plugins that they are alive and are ready
|
||||
// to receive configuration
|
||||
case 'sitespeedio.setup': {
|
||||
|
|
@ -105,12 +105,18 @@ export default class BrowsertimePlugin extends SitespeedioPlugin {
|
|||
if (this.options.urlMetaData) {
|
||||
for (let url of Object.keys(this.options.urlMetaData)) {
|
||||
const alias = this.options.urlMetaData[url];
|
||||
const group = new URL(url).hostname;
|
||||
this.allAlias[alias] = url;
|
||||
super.sendMessage('browsertime.alias', alias, {
|
||||
url,
|
||||
group
|
||||
});
|
||||
try {
|
||||
const group = new URL(url).hostname;
|
||||
this.allAlias[alias] = url;
|
||||
super.sendMessage('browsertime.alias', alias, {
|
||||
url,
|
||||
group
|
||||
});
|
||||
} catch (error) {
|
||||
log.error(
|
||||
'Could not get group for URL:' + url + ' with error' + error
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue