seems strange try.. catch to me
please remove, and just put the default empty string
so 
String givenCaseId = (String) build.getEnvVars().get("CASE_ID", "");