better error handling for node 0.10