add debug information on error