tods-competition-factory 1.6.29 → 1.7.0

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.
@@ -408,7 +408,8 @@ var syncGlobalState$1 = {
408
408
  setSubscriptions,
409
409
  setTournamentId,
410
410
  setTournamentRecord,
411
- setTournamentRecords
411
+ setTournamentRecords,
412
+ handleCaughtError
412
413
  };
413
414
  function disableNotifications() {
414
415
  syncGlobalState.disableNotifications = true;
@@ -514,6 +515,26 @@ function callListener({ topic, notices }) {
514
515
  method(notices);
515
516
  }
516
517
  }
518
+ function handleCaughtError({
519
+ engineName,
520
+ methodName,
521
+ params,
522
+ err
523
+ }) {
524
+ let error;
525
+ if (typeof err === "string") {
526
+ error = err.toUpperCase();
527
+ } else if (err instanceof Error) {
528
+ error = err.message;
529
+ }
530
+ console.log("ERROR", {
531
+ tournamentId: getTournamentId(),
532
+ params: JSON.stringify(params),
533
+ engine: engineName,
534
+ methodName,
535
+ error
536
+ });
537
+ }
517
538
 
518
539
  const globalState = {
519
540
  tournamentFactoryVersion: "0.0.0",