Refactor handle_update_add_htlc to wrapper error handling function