Added exception handling to npm registry request