Catch runtime exception when a 5xx HTTP error occurs