survana.js: Add code to POST errors to /debug