move withParsedError into error.js