Just for code clarity purposes, I'd go with:
```
if (r.getMessage().equals("Child job running failed")) {
  System.err.println("Exception in child job while processing " + resourceUrl_<%=cid%>);
  r.printStackTrace(); 
} else {
  throw r;
}
```

More lines, but IMO it's clearer, as the ! is a bit sneaky :)