test error handling when loading agent.js