Use closure-compiler's error-handling, instead of re-inventing the wheel