@promptbook/website-crawler 0.77.0 → 0.77.1

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.
package/esm/index.es.js CHANGED
@@ -24,7 +24,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
24
24
  *
25
25
  * @see https://github.com/webgptorg/promptbook
26
26
  */
27
- var PROMPTBOOK_ENGINE_VERSION = '0.77.0-6';
27
+ var PROMPTBOOK_ENGINE_VERSION = '0.77.0';
28
28
  /**
29
29
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
30
30
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -2190,7 +2190,7 @@ var LimitReachedError = /** @class */ (function (_super) {
2190
2190
  *
2191
2191
  * @public exported from `@promptbook/core`
2192
2192
  */
2193
- var ERRORS = {
2193
+ var PROMPTBOOK_ERRORS = {
2194
2194
  AbstractFormatError: AbstractFormatError,
2195
2195
  CsvFormatError: CsvFormatError,
2196
2196
  CollectionError: CollectionError,
@@ -2208,6 +2208,35 @@ var ERRORS = {
2208
2208
  UnexpectedError: UnexpectedError,
2209
2209
  // TODO: [🪑]> VersionMismatchError,
2210
2210
  };
2211
+ /**
2212
+ * Index of all javascript errors
2213
+ *
2214
+ * @private for internal usage
2215
+ */
2216
+ var COMMON_JAVASCRIPT_ERRORS = {
2217
+ Error: Error,
2218
+ EvalError: EvalError,
2219
+ RangeError: RangeError,
2220
+ ReferenceError: ReferenceError,
2221
+ SyntaxError: SyntaxError,
2222
+ TypeError: TypeError,
2223
+ URIError: URIError,
2224
+ AggregateError: AggregateError,
2225
+ /*
2226
+ Note: Not widely supported
2227
+ > InternalError,
2228
+ > ModuleError,
2229
+ > HeapError,
2230
+ > WebAssemblyCompileError,
2231
+ > WebAssemblyRuntimeError,
2232
+ */
2233
+ };
2234
+ /**
2235
+ * Index of all errors
2236
+ *
2237
+ * @private for internal usage
2238
+ */
2239
+ var ALL_ERRORS = __assign(__assign({}, PROMPTBOOK_ERRORS), COMMON_JAVASCRIPT_ERRORS);
2211
2240
  /**
2212
2241
  * Note: [💞] Ignore a discrepancy between file name and entity name
2213
2242
  */
@@ -2218,11 +2247,11 @@ var ERRORS = {
2218
2247
  * @public exported from `@promptbook/utils`
2219
2248
  */
2220
2249
  function deserializeError(error) {
2221
- if (error.name === 'Error') {
2222
- return new Error(error.message);
2250
+ var ErrorClass = ALL_ERRORS[error.name];
2251
+ if (ErrorClass === undefined) {
2252
+ return new Error("".concat(error.name, ": ").concat(error.message));
2223
2253
  }
2224
- var CustomError = ERRORS[error.name];
2225
- return new CustomError(error.message);
2254
+ return new ErrorClass(error.message);
2226
2255
  }
2227
2256
 
2228
2257
  /**
@@ -2296,8 +2325,8 @@ function isPipelinePrepared(pipeline) {
2296
2325
  */
2297
2326
  function serializeError(error) {
2298
2327
  var name = error.name, message = error.message, stack = error.stack;
2299
- if (!__spreadArray(['Error'], __read(Object.keys(ERRORS)), false).includes(name)) {
2300
- throw new UnexpectedError(spaceTrim$1(function (block) { return "\n \n Cannot serialize error with name \"".concat(name, "\"\n\n ").concat(block(stack || message), "\n \n "); }));
2328
+ if (!Object.keys(ALL_ERRORS).includes(name)) {
2329
+ console.error(spaceTrim$1(function (block) { return "\n \n Cannot serialize error with name \"".concat(name, "\"\n\n ").concat(block(stack || message), "\n \n "); }));
2301
2330
  }
2302
2331
  return {
2303
2332
  name: name,