biocore / LabControl

lab manager for plate maps and sequence flows
BSD 3-Clause "New" or "Revised" License
2 stars 15 forks source link

Provide more explicit capture of error from PoolListHandler.get given unknown pool type? #512

Open AmandaBirmingham opened 5 years ago

AmandaBirmingham commented 5 years ago

Currently, PoolListHandler.get throws a 500 error if it is passed a pool type that it doesn't recognize. This is as it should be :) However, one of the places this get is used is within an ajax call in sequencing.html:

https://github.com/jdereus/labman/blob/46241e448edd4fc615aeea914e8dd80bf88aad79/labcontrol/gui/templates/sequencing.html#L100-L108

At the moment there is no handling in place for errors from this ajax call, so if the 500 error is encountered, it is not handled and the code just keeps running. This leads to a cryptic error later in which the DataTable cannot be created because no results were returned from the ajax call:

Screen Shot 2019-05-06 at 4 54 01 PM

At least the user can't make a garbage output, but clearly we could do better here.

This issue should be addressed before adding any new protocols to the software (as those could lead to new pool types). Related to #509 Centralize and harden identification of pool component types and probably to #510 PoolListHandler.get would identify pools from future new protocols as amplicon sequencing pools . Similar to #405 Silent 500 errors when plating samples.

charles-cowart commented 5 years ago

Thanks @AmandaBirmingham ! This looks like another good entry-level issue for @fedarko and/or @qiyunzhu and myself.

AmandaBirmingham commented 5 years ago

@fedarko @qiyunzhu @charles-cowart Whoever is tackling this, please use the .fail(function(..)) on the ajax call (see skeleton example below in addPlateModal.js) to set up explicit ajax error handling.

https://github.com/jdereus/LabControl/blob/3d85d70a4b65ddd22baaa306120b77403e08de47/labcontrol/gui/static/js/addPlateModal.js#L59-L77