quicktype-core 23.0.3 → 23.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1280,7 +1280,8 @@ class CPlusPlusRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
1280
1280
  });
1281
1281
  onFirst = false;
1282
1282
  }
1283
- this.emitLine('else throw "Could not deserialize";');
1283
+ // this.emitLine('else throw "Could not deserialize";');
1284
+ this.emitLine('else throw std::runtime_error("Could not deserialise!");');
1284
1285
  });
1285
1286
  this.ensureBlankLine();
1286
1287
  this.emitBlock(["inline void adl_serializer<", variantType, ">::to_json(json & j, ", this.withConst(variantType), " & x)"], false, () => {
@@ -1308,7 +1309,8 @@ class CPlusPlusRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
1308
1309
  });
1309
1310
  i++;
1310
1311
  }
1311
- this.emitLine('default: throw "Input JSON does not conform to schema";');
1312
+ // this.emitLine('default: throw "Input JSON does not conform to schema";');
1313
+ this.emitLine('default: throw std::runtime_error("Input JSON does not conform to schema!");');
1312
1314
  });
1313
1315
  });
1314
1316
  }
@@ -1350,7 +1352,8 @@ class CPlusPlusRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
1350
1352
  this.emitLine(maybeElse, "if (j == ", this._stringType.wrapEncodingChange([ourQualifier], this._stringType.getType(), this.NarrowString.getType(), [this._stringType.createStringLiteral([(0, Strings_1.stringEscape)(jsonName)])]), ") x = ", ourQualifier, enumName, "::", name, ";");
1351
1353
  onFirst = false;
1352
1354
  });
1353
- this.emitLine('else throw "Input JSON does not conform to schema";');
1355
+ // this.emitLine('else throw "Input JSON does not conform to schema";');
1356
+ this.emitLine('else { throw std::runtime_error("Input JSON does not conform to schema!"); }');
1354
1357
  }
1355
1358
  });
1356
1359
  this.ensureBlankLine();
@@ -1359,7 +1362,8 @@ class CPlusPlusRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
1359
1362
  this.forEachEnumCase(e, "none", (name, jsonName) => {
1360
1363
  this.emitLine("case ", ourQualifier, enumName, "::", name, ": j = ", this._stringType.wrapEncodingChange([ourQualifier], this._stringType.getType(), this.NarrowString.getType(), [this._stringType.createStringLiteral([(0, Strings_1.stringEscape)(jsonName)])]), "; break;");
1361
1364
  });
1362
- this.emitLine('default: throw "This should not happen";');
1365
+ // this.emitLine('default: throw "This should not happen";');
1366
+ this.emitLine('default: throw std::runtime_error("This should not happen");');
1363
1367
  });
1364
1368
  });
1365
1369
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quicktype-core",
3
- "version": "23.0.3",
3
+ "version": "23.0.4",
4
4
  "description": "The quicktype engine as a library",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",