use a local flow calculation, determine depressions, and link them using a minimum spanning tree (Boruvka's algorithm).
This is based on a paper by Cordonnier et al, 2019.
Since map preview is optional, an exception should not propagate to terrain calculation, so print an error message + traceback but keep the script running.