feat(core): mark errors as retryable or not, and stop retrying the ones that aren't (#11342)