mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-04 12:58:01 +00:00
Add some error checking
This commit is contained in:
parent
db9978f8c2
commit
2e4980bb97
@ -57,6 +57,9 @@ function loadStore(store) {
|
|||||||
savePlugin = function(pluginFields,type,publisher,name) {
|
savePlugin = function(pluginFields,type,publisher,name) {
|
||||||
const bagName = makePluginBagName(type,publisher,name);
|
const bagName = makePluginBagName(type,publisher,name);
|
||||||
const result = store.createBag(bagName,pluginFields.description || "(no description)",{allowPrivilegedCharacters: true});
|
const result = store.createBag(bagName,pluginFields.description || "(no description)",{allowPrivilegedCharacters: true});
|
||||||
|
if(result !== null) {
|
||||||
|
throw `Error creating plugin bag ${bagname}`;
|
||||||
|
}
|
||||||
store.saveBagTiddler(pluginFields,bagName);
|
store.saveBagTiddler(pluginFields,bagName);
|
||||||
},
|
},
|
||||||
collectPlugins = function(folder,type,publisher) {
|
collectPlugins = function(folder,type,publisher) {
|
||||||
@ -99,7 +102,10 @@ function loadStore(store) {
|
|||||||
}
|
}
|
||||||
if(wikiInfo) {
|
if(wikiInfo) {
|
||||||
// Create the bag
|
// Create the bag
|
||||||
store.createBag(options.bagName,options.bagDescription);
|
const result = store.createBag(options.bagName,options.bagDescription);
|
||||||
|
if(!result) {
|
||||||
|
throw `Error creating bag ${options.bagName} for edition ${options.wikiPath}`;
|
||||||
|
}
|
||||||
// Add plugins to the recipe list
|
// Add plugins to the recipe list
|
||||||
const recipeList = [];
|
const recipeList = [];
|
||||||
const processPlugins = function(type,plugins) {
|
const processPlugins = function(type,plugins) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user