angular-ui/ui-grid

Exceptions raised by ui-grid or ui-grid plugin code is caught and not logged in the console

Open

#7 211 ouverte le 15 févr. 2022

Voir sur GitHub
 (3 commentaires) (0 réactions) (0 assignés)JavaScript (2 496 forks)batch import
good first issuegrid-core

Métriques du dépôt

Stars
 (5 395 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

When an exception is raised, the end of the following code:

function startProcessor(i, renderedRowsToProcess) {
      // Get the processor at 'i'
      var processor = self.rowsProcessors[i].processor;

      // Call the processor, passing in the rows to process and the current columns
      //   (note: it's wrapped in $q.when() in case the processor does not return a promise)
      return $q.when( processor.call(self, renderedRowsToProcess, self.columns) )
        .then(function handleProcessedRows(processedRows) {
          // Check for errors
          if (!processedRows) {
            throw "Processor at index " + i + " did not return a set of renderable rows";
          }

          if (!angular.isArray(processedRows)) {
            throw "Processor at index " + i + " did not return an array";
          }

         // Processor is done, increment the counter
          i++;

          // If we're not done with the processors, call the next one
          if (i <= self.rowsProcessors.length - 1) {
            return startProcessor(i, processedRows);
          }
          // We're done! Resolve the 'finished' promise
          else {
            finished.resolve(processedRows);
          }
        }).catch(angular.noop);
    }

In the original code, the exception is rethrown using the following code.

}).catch(function(error) {
    throw error;
});

The reason for raising this bug is that when using the ui-grid-auto-fit-columns plugin with in empty array of columnDefs, the plugin throws an exception but this exception cannot be seen in the console log to see the reason why the plugin is not working.

Guide contributeur