Opentrons / opentrons

Software for writing protocols and running them on the Opentrons Flex and Opentrons OT-2
https://opentrons.com
Apache License 2.0
419 stars 178 forks source link

bug: prettify error message while h/s is shaking and protocol tries to unlatch #11182

Open TamarZanzouri opened 2 years ago

TamarZanzouri commented 2 years ago

Overview

While h/s is shaking try running a protocol with an unlatching command. The command will raise an error as expected but the UI should show a user friendly message?

Steps to reproduce

  1. test shaking with the h/s
  2. run the following protocol
metadata = {
    'protocolName': 'Heater-shaker test protocol w/ blocking commands',
    'author': 'Opentrons <protocols@opentrons.com>',
    'apiLevel': '2.12'
}

def run(context):
    # Load Heater-shaker module
    hs_mod = context.load_module("heaterShakerModuleV1", "1")

    # Load adapter + labware on module. Available labware:
    # - opentrons_96_flat_bottom_adapter_nest_wellplate_200ul_flat
    # - opentrons_96_pcr_plate_adapter_nest_wellplate_100ul_pcr_full_skirt
    # - opentrons_96_deepwell_adapter_nest_wellplate_2ml_deep
    # - opentrons_flat_plate_adapter_corning_384_wellplate_112ul_flat
    hs_plate = hs_mod.load_labware("opentrons_96_flat_bottom_adapter_nest_wellplate_200ul_flat")

    # tiprack_300ul = [context.load_labware('opentrons_96_tiprack_300ul', 3)]
    # p20 = context.load_instrument('p300_single', 'right', tip_racks=tiprack_300ul)

    tiprack_10ul = [context.load_labware('opentrons_96_tiprack_300ul', 5)]
    p20 = context.load_instrument('p300_single_gen2', 'right', tip_racks=tiprack_10ul)

    reservoir = context.load_labware('agilent_1_reservoir_290ml', 4)

    hs_mod.open_labware_latch()

    hs_mod.set_and_wait_for_temperature(celsius=80)  # Waits until H/S is at 80C

    p20.pick_up_tip()
    p20.aspirate(10, reservoir['A1'])
    p20.dispense(10, hs_plate['A1'])
    p20.drop_tip()

    hs_mod.close_labware_latch()
    hs_mod.set_and_wait_for_shake_speed(rpm=500)    # Waits until H/S has reached 500rpm speed

    context.delay(minutes=1)

    hs_mod.deactivate_shaker()
    hs_mod.deactivate_heater()

this will result with the following error:

Screen Shot 2022-07-19 at 4 39 21 PM

Expected behavior

User friendly error message

SyntaxColoring commented 2 years ago

In my opinion, this is mostly expected behavior.

Breaking the error message down: