record.js: check for errors