JI-942 Add missing library error message

content-upgrade-on-upload
Frode Petterson 2019-02-01 13:03:27 +01:00
parent c9e1ac9347
commit f96d04cc27
2 changed files with 10 additions and 0 deletions

View File

@ -54,6 +54,12 @@ H5P.ContentUpgradeProcess = (function (Version) {
if (err) {
return done(err);
}
if (library.semantics === null) {
return done({
type: 'libraryMissing',
library: library.name + ' ' + library.version.major + '.' + library.version.minor
});
}
// Run upgrade routines on params
self.processParams(library, oldVersion, newVersion, params, metadata, function (err, params, metadata) {

View File

@ -422,6 +422,10 @@
error = info.errorContent.replace('%id', error.id) + ' ' + info.errorParamsBroken;
break;
case 'libraryMissing':
error = info.errorLibrary.replace('%lib', error.library);
break;
case 'scriptMissing':
error = info.errorScript.replace('%lib', error.library);
break;