update to match pseudocode, log reason for no action, and catch more errors
update to match pseudocode, log reason for no action, and catch more errors

timomer/openaps-js,seattlebrighton/openaps-js,tghoward/openaps-js,openaps/oref0,tghoward/openaps-js,openaps/openaps-js,scottleibrand/openaps-sh,seattlebrighton/openaps-js,esteward/openaps-js,cjo20/openaps-js,jasoncalabrese/openaps-js,timomer/openaps-js,jasoncalabrese/openaps-js,PieterGit/oref0,audiefile/openaps-js,audiefile/openaps-js,PieterGit/oref0,esteward/openaps-js,openaps/openaps-js,PieterGit/oref0,openaps/oref0,openaps/oref0,oskarpearson/openaps-js,oskarpearson/openaps-js,cjo20/openaps-js,openaps/oref0,PieterGit/oref0