Add promises to the widget framework.

Parallel to @jasongrout 's solution (human race condition).
perhaps we use this (log this error, return an error) function enough to make it a utils function.