Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
while (file) {
const reader = new FileReader();
reader.onload = readerOnload();
reader.readAsText(file);
i += 1;
file = files[i];
}
}
const wnd: any = window;
// Check for the various File API support.
if (wnd.File && wnd.FileReader && wnd.FileList && wnd.Blob) {
// Something
elem[0].addEventListener('change', file_selected, false);
} else {
appEvents.emit(AppEvents.alertError, ['Oops', 'The HTML5 File APIs are not fully supported in this browser']);
}
},
};
.catch(err => {
if (!err.message && err.data && err.data.message) {
err.message = err.data.message;
}
console.log('AnnotationSrv.query error', err);
this.$rootScope.appEvent(AppEvents.alertError, ['Annotation Query Failed', err.message || err]);
return [];
});
}
.catch(e => {
appEvents.emit(AppEvents.alertError, ['Template variable service failed', e.message]);
});
}
return variableSrv.updateOptions($scope.current).catch((err: { data: { message: any }; message: string }) => {
if (err.data && err.data.message) {
err.message = err.data.message;
}
appEvents.emit(AppEvents.alertError, [
'Templating',
'Template variables could not be initialized: ' + err.message,
]);
});
};
.catch(err => {
if (!err.message && err.data && err.data.message) {
err.message = err.data.message;
}
console.log('AnnotationSrv.query error', err);
this.$rootScope.appEvent(AppEvents.alertError, ['Annotation Query Failed', err.message || err]);
return [];
});
}
(err: any) => {
console.log('Script dashboard error ' + err);
this.$rootScope.appEvent(AppEvents.alertError, [
'Script Error',
'Please make sure it exists and returns a valid dashboard',
]);
return this._dashboardLoadFailed('Scripted dashboard');
}
);
const app = await getPluginSettings(pluginId).then(info => {
const error = getAppPluginPageError(info);
if (error) {
appEvents.emit(AppEvents.alertError, [error]);
this.setState({ nav: getWarningNav(error) });
return null;
}
return importAppPlugin(info);
});
this.setState({ plugin: app, loading: false });
}
if (err.status === 422) {
appEvents.emit(AppEvents.alertWarning, ['Validation failed', data.message]);
throw data;
}
if (data.message) {
let description = '';
let message = data.message;
if (message.length > 80) {
description = message;
message = 'Error';
}
appEvents.emit(err.status < 500 ? AppEvents.alertWarning : AppEvents.alertError, [message, description]);
}
throw data;
}
() => {
this.$scope.appEvent(AppEvents.alertError, ['Unable to save playlist']);
}
);
() => {
this.$scope.appEvent(AppEvents.alertError, ['Unable to delete playlist']);
this.playlists.push(playlist);
}
);