message: refactor: make the error richer
diff: @@ -68,15 +68,19 @@ FbN2oDHyPaO5j1tTaBNyVt8CAwEAAQ==
  throw new Error(statusMessage);
  }
  function parseProfile(o: any) {
  - if (o.properties) {
  - const properties = o.properties;
  - const to: any = {};
  - for (const prop of properties) {
  - if (prop.signature && pemPubKey && !checkSign(prop.value, prop.signature, pemPubKey)) {
  - throw { type: "SignatureMissMatch" };
  + if (typeof o.id !== "string" || typeof o.name !== "string") {
  + throw new Error(`Corrupted profile response ${JSON.stringify(o)}`);
  }
  + if (o.properties && o.properties instanceof Array) {
  + const properties = o.properties as Array<{ name: string; value: string; signature: string; }>;
  + const to: { [key: string]: string } = {};
  + for (const prop of properties) {
  + if (prop.signature && pemPubKey && !checkSign(prop.value, prop.signature, pemPubKey.toString())) {
  + console.warn(`Discard corrupted prop ${prop.name}: ${prop.value} as the signature mismatched!`);
  + } else {
  to[prop.name] = prop.value;
  }
  + }
  o.properties = to;
  }
  return o as GameProfile;
  