forked from firefox-devtools/profiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrors.js
25 lines (21 loc) · 871 Bytes
/
errors.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// @flow
import type { RequestedLib } from 'firefox-profiler/types';
// Used during the symbolication process to express that we couldn't find
// symbols for a specific library
export class SymbolsNotFoundError extends Error {
library: RequestedLib;
errors: Error[];
constructor(message: string, library: RequestedLib, ...errors: Error[]) {
super(
[message, ...errors.map((e) => ` - ${e.name}: ${e.message}`)].join('\n')
);
// Workaround for a babel issue when extending Errors
(this: any).__proto__ = SymbolsNotFoundError.prototype;
this.name = 'SymbolsNotFoundError';
this.library = library;
this.errors = errors;
}
}