better error reporting for invalid json in before / request blocks