Handle errors in branchOrder test code