Improve BEMTREE error handling

As discussed #594
can be done with ternary if: `promise = onRejected? ... : ...;`