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 建立於 2022年2月15日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)JavaScript (5,395 star) (2,496 fork)batch import
good first issuegrid-core

描述

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.

貢獻者指南