Move debug message before potential error.