add debug output to exception