@promptbook/remote-client 0.89.0-14 → 0.89.0-16

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
@@ -20,7 +20,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
20
20
  * @generated
21
21
  * @see https://github.com/webgptorg/promptbook
22
22
  */
23
- const PROMPTBOOK_ENGINE_VERSION = '0.89.0-14';
23
+ const PROMPTBOOK_ENGINE_VERSION = '0.89.0-16';
24
24
  /**
25
25
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
26
26
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -238,7 +238,7 @@ class PipelineExecutionError extends Error {
238
238
  }
239
239
  }
240
240
  /**
241
- * TODO: !!!!!! Add id to all errors
241
+ * TODO: [🧠][🌂] Add id to all errors
242
242
  */
243
243
 
244
244
  /**
@@ -320,6 +320,7 @@ const ADMIN_EMAIL = 'pavol@ptbk.io';
320
320
  * @public exported from `@promptbook/core`
321
321
  */
322
322
  const ADMIN_GITHUB_NAME = 'hejny';
323
+ // <- TODO: [🐊] Pick the best claim
323
324
  /**
324
325
  * When the title is not provided, the default title is used
325
326
  *
@@ -452,15 +453,12 @@ class WrappedError extends Error {
452
453
  constructor(whatWasThrown) {
453
454
  const tag = `[🤮]`;
454
455
  console.error(tag, whatWasThrown);
455
- super(spaceTrim((block) => `
456
- ${ /* Fixing tests !!! block(valueToString(whatWasThrown)) */block(`non-Error object was thrown`)}
457
-
458
- Note: Look for ${tag} in the console for more details
459
- !!! Note: \`WrappedError\` indicates that somewhere in the code non-Error object was thrown and it was wrapped
460
-
461
- Please report issue on ${ADMIN_EMAIL}
456
+ super(spaceTrim(`
457
+ Non-Error object was thrown
462
458
 
463
- `));
459
+ Note: Look for ${tag} in the console for more details
460
+ Please report issue on ${ADMIN_EMAIL}
461
+ `));
464
462
  this.name = 'WrappedError';
465
463
  Object.setPrototypeOf(this, WrappedError.prototype);
466
464
  }
@@ -1564,29 +1562,30 @@ const bookVersionCommandParser = {
1564
1562
  };
1565
1563
 
1566
1564
  /**
1567
- * !!!@@@
1565
+ * Helper used in catch blocks to assert that the error is an instance of `Error`
1568
1566
  *
1569
- * @param whatWasThrown !!!@@@
1570
- * @returns !!!@@@
1567
+ * @param whatWasThrown Any object that was thrown
1568
+ * @returns Nothing if the error is an instance of `Error`
1569
+ * @throws `WrappedError` or `UnexpectedError` if the error is not standard
1571
1570
  *
1572
1571
  * @private within the repository
1573
1572
  */
1574
1573
  function assertsError(whatWasThrown) {
1575
- // Case 1: !!!@@@
1574
+ // Case 1: Handle error which was rethrown as `WrappedError`
1576
1575
  if (whatWasThrown instanceof WrappedError) {
1577
1576
  const wrappedError = whatWasThrown;
1578
1577
  throw wrappedError;
1579
1578
  }
1580
- // Case 2: !!!@@@
1579
+ // Case 2: Handle unexpected errors
1581
1580
  if (whatWasThrown instanceof UnexpectedError) {
1582
1581
  const unexpectedError = whatWasThrown;
1583
1582
  throw unexpectedError;
1584
1583
  }
1585
- // Case 3: !!!@@@
1584
+ // Case 3: Handle standard errors - keep them up to consumer
1586
1585
  if (whatWasThrown instanceof Error) {
1587
1586
  return;
1588
1587
  }
1589
- // Case 4: !!!@@@
1588
+ // Case 4: Handle non-standard errors - wrap them into `WrappedError` and throw
1590
1589
  throw new WrappedError(whatWasThrown);
1591
1590
  }
1592
1591