Improve handling of errors occurring not as part of any endpoint