Yeah, Cesium should correctly handle a 404 as "missing", so I think you can just remove this discard stuff.  Removing it should improve performance a bit, too.