Skip to content
Snippets Groups Projects
Commit 6fe83a9a authored by Alexander Rose's avatar Alexander Rose
Browse files

cellpack: fixed pdb fallback when opm fails

parent 20af0841
No related branches found
No related tags found
No related merge requests found
......@@ -68,11 +68,13 @@ async function getModel(plugin: PluginContext, id: string, ingredient: Ingredien
}
} else if (id.match(/^[1-9][a-zA-Z0-9]{3,3}$/i)) {
if (surface){
try {
const data = await getFromOPM(plugin, id, assetManager);
if (data.asset){
assets.push(data.asset);
trajectory = await plugin.runTask(trajectoryFromPDB(data.pdb));
} else {
} catch (e) {
// fallback to getFromPdb
// console.error(e);
const { mmcif, asset } = await getFromPdb(plugin, id, assetManager);
assets.push(asset);
trajectory = await plugin.runTask(trajectoryFromMmCIF(mmcif));
......
......@@ -241,9 +241,8 @@ function processAjax<T extends DataType>(req: XMLHttpRequest, type: T): DataResp
}
throw new Error(`could not get requested response data '${type}'`);
} else {
const status = req.statusText;
RequestPool.deposit(req);
throw new Error(status);
throw new Error(`Download failed with status code ${req.status}`);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment