Give a better error when a KDMFormatError is thrown (DoM #2446).