Avoid NPE inside the exception toString() when metadata is not available