Skip to content

Commit

Permalink
fix: show error messages from lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmacdonald committed Oct 19, 2018
1 parent 3ae029b commit ce29b84
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function find(query) {
(entitySource, entitySourceName)=>{
entitySource[currentSearchOptions.entityLookupMethodName](query).then(
(results)=>showResults(results, entitySourceName),
(error)=>console.log(`an error in the find: ${error}`))
(error)=>showError(error, entitySourceName))
}
)
}
Expand Down Expand Up @@ -258,6 +258,11 @@ function showResults(results, entitySourceName) {
}
}

function showError(error, entitySourceName) {
let resultList = $(`#cwrc-${entitySourceName}-list`);
resultList.append(`<li class="list-group-item list-group-item-danger">${error}</li>`)
}

const panelDefs = [{
id: 'cwrc',
title: 'CWRC'
Expand Down

0 comments on commit ce29b84

Please sign in to comment.