I tried to implement it in our code with logic like this, but it's not working. I'd totally appreciate any assistance/guidance in checking the response code properly:
catch (SparkPostErrorServerResponseException spex) {
...
else if (500 <= spex.getResponseCode() && spex.getResponseCode() < 510){
Logger.log("Sparkpost " + spex.getResponseCode() + " errors, skipping for now: " + em.id);
...
Thanks!