Add more debug info to error messages