mirror of
https://github.com/zadam/trilium.git
synced 2024-09-20 23:55:59 +08:00
error handling
This commit is contained in:
parent
ddf8438b22
commit
208baa56e9
|
@ -193,6 +193,10 @@ function getNoteTypeClass(type) {
|
|||
}
|
||||
|
||||
function getMimeTypeClass(mime) {
|
||||
if (!mime) {
|
||||
return "";
|
||||
}
|
||||
|
||||
const semicolonIdx = mime.indexOf(';');
|
||||
|
||||
if (semicolonIdx !== -1) {
|
||||
|
|
|
@ -238,7 +238,15 @@ async function findSimilarNotes(noteId) {
|
|||
return [];
|
||||
}
|
||||
|
||||
const dateLimits = buildDateLimits(baseNote);
|
||||
let dateLimits;
|
||||
|
||||
try {
|
||||
dateLimits = buildDateLimits(baseNote);
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error(`Date limits failed with ${e.message}, entity: ${JSON.stringify(baseNote.pojo)}`);
|
||||
}
|
||||
|
||||
const rewardMap = buildRewardMap(baseNote);
|
||||
let ancestorRewardCache = {};
|
||||
const ancestorNoteIds = new Set(baseNote.ancestors.map(note => note.noteId));
|
||||
|
|
Loading…
Reference in a new issue