tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

exceptions.js (881B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
      4 
      5 export function addExceptionFromResources(resources) {
      6  return async function ({ dispatch }) {
      7    for (const resource of resources) {
      8      const { pageError } = resource;
      9      if (!pageError.error) {
     10        continue;
     11      }
     12      const { columnNumber, lineNumber, sourceId, errorMessage } = pageError;
     13      const stacktrace = pageError.stacktrace || [];
     14 
     15      const exception = {
     16        columnNumber,
     17        lineNumber,
     18        sourceActorId: sourceId,
     19        errorMessage,
     20        stacktrace,
     21        threadActorId: resource.targetFront.targetForm.threadActor,
     22      };
     23 
     24      dispatch({
     25        type: "ADD_EXCEPTION",
     26        exception,
     27      });
     28    }
     29  };
     30 }