Return exception for debugging in head.js