Skip to content

Commit

Permalink
show error message from vcfGenotypeLookup
Browse files Browse the repository at this point in the history
paths-progressive.js : vcfGenotypeLookup() :
.catch result of vcfFeature : vcfGenotypeLookup and show error.responseJSON.error.message, using added showText(), copied from components/draw/axis-1d.js : drawTicks() : showText(),  which uses service data/heads-up.
  • Loading branch information
Don-Isdale committed Aug 26, 2024
1 parent 1d32e4f commit 0791873
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions frontend/app/services/data/paths-progressive.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export default Service.extend({
apiServers : service(),
controls : service(),
selectedService : service('data/selected'),
headsUp : service('data/heads-up'),

/** set up a block-adj object to hold results. */
ensureBlockAdj(blockAdjId) {
Expand Down Expand Up @@ -850,6 +851,7 @@ export default Service.extend({

vcfGenotypeLookup(block, paramAxis) {
const
fnName = 'vcfGenotypeLookup',
/** params for */
vcfDatasetId = block.get('datasetId.genotypeId'),
domain = paramAxis.domain || block.get('axis1d.domain'),
Expand Down Expand Up @@ -885,8 +887,26 @@ export default Service.extend({
requestOptions, vcfDatasetId, block.name, rowLimit
);

textP
/* can add .then(result => this.showText('')), possibly with a source label
* param so that error streams are independent. */
.catch(error => {
dLog(fnName, 'catch', error);
this.showText(error.responseJSON.error.message);
});
return textP;
},


/** Display text for user messages / notifications.
* @param text
*/
showText(text) {
// copied from components/draw/axis-1d.js : drawTicks() : showText()
if (! this.get('isDestroying') && ! this.get('headsUp.isDestroying')) {
this.set('headsUp.tipText', text);
}
},


});

0 comments on commit 0791873

Please sign in to comment.