pruned onError method